February 2018
Beginner to intermediate
348 pages
9h 40m
English
At the time of installing MySQL server, you were asked to set up administrator (root) credentials. Since these credentials allow full access to the SQL server, including permissions on all databases, you should never use them in any of your PHP applications. The best practice is to create a separate MySQL user and to assign permissions on the database that will be used by your application. Log in to your local MySQL server with the following command:
# mysql -u root -p
Create a new SQL database:
mysql> CREATE DATABASE wordpress;
Create a SQL user and grant all permissions to the wordpress database (don't forget to specify a complex enough password):
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost' ...
Read now
Unlock full access