Code snippets, tips, how-tos

Tag: mysql

  • MySQL user management from the command line

    List or delete users from the command line. MySQL stores the list of users in the mysql.user table. List of all databases are available in the mysql.db table. Show list of MySQL users Show list of databases for a user Delete a user

    Read more

  • Export / Import a MySQL database between remote server and local machine

    Upload or download a MySQL database between a remote server and localhost using the command line. Download a remote MySQL database Download a remote MySQL database using mysqldump dump. The output of the dump is compressed using gzip and the output of the zip is downloaded into the file remotedb.sql. Copy local database to remote […]

    Read more

  • Create a new MySQL user from the command line

    Create and add a user to a MySQL database using the command line. Run MySQL Open MySQL using the below command. The username should be your root user or an admin user with access for creating other users. Create a database and a user Create a new database (if required) and create a new user. […]

    Read more

  • Set MySQL password from the command line

    If your MySQL root user’s password is currently empty (not set) and you want to add one to disable access without password, use the following commands. Open MySQL my entering the below in your command line: Here, mysql.user is the database which has the list of all the MySQL users. So the command breaks down […]

    Read more