Tag: mysql
-
Importing a MySQL database with a new name where the original still exists
So you want to export your MySQL database then import it on the same server with a new name. I tried this several times and using the SOURCE command inside MySQL or just mysql -p < db.sql both resulted in the database re-importing over the original name. To fix that run: sed -i…
-
MySQL: How to log in
If you’re unfamiliar with MySQL you may be following a guide which instructs you to log in as root without actually telling you how; use the following: mysql -u root -p This logs you in as the root user (-u signifying which user you want to log in as) and -p signifies…
-
MySQL: How to create a database
To create a simple database (e.g. if you need to create one for a WordPress or Wiki install) use the following after logging in to MySQL as the root user: create database [nameOfDatabase]; Don’t forget the ; at the end, or you’ll end up on a new line consisting of a >…
-
MySQL: Changing the root user’s password
If you need to change the MySQL root user’s password use the following from a command prompt: mysqladmin -u root -p password NEWPASSWORD Enter the current root password when prompted and replace NEWPASSWORD with the desired password. This should return you to the command prompt, and you can test whether it was…
-
How to change a user’s password in Mediawiki
If you have a wiki you may need to change a user’s password from time to time; you can do this from the back end quite easily. First, access mysql: mysql -u root -p Log in using your root password. Next, list your databases: show databases; On our test system this…
-
How To: Export all mysql databases for backup
This is a handy command for anyone using multiple mysql databases – it produces a single file which you can easily back up to elsewhere. mysqldump -u root -p –all-databases > databasesBackup.sql Note the two hyphens before “all”. This command creates the file databasesBackup.sql which contains the contents of all of your databases.…