Setup a new database on server
Hello,
I need help creating 2 new databases on a server, Can you please help me. When I login my existing PHPMyAdmin and use the existing username and password I am not able to create new database. Can you please let me know how to create a new database.
1 Reply
Hello,
I found this guide online that will walk you through creating a database through PHPMyadmin.
Furthermore, you can create a database and user through MySQL by running the below commands. Linode aslo has an awesome guide on this.
First start MySQL, and login with your root user.
mysql -u root -p
Then create the database (Change newdatabase to the database name you would like).
create database newdatabase;
Now we need to create the new database user. As above, change newdatabase to the database name you would like, also change the newuser to your desired username for this database and newpassword to the password you would like to use.
grant all privileges on newdatabase.* to 'newuser'@'localhost' identified by "newpassword";
After the user is created run the following.
flush privileges;
Then you can exit MySQL by running.
exit;