MySQL initialization procedure bitsCN.com
MySQL initialization steps
When I was using MySQL, I certainly encountered a problem where PHP could not connect to the database. Now, let's take a look at the work to be done, on the premise that you have added the mysql working directory to the environment variable.
The initialization steps are as follows:
Set the password for the root user:
[SQL]
Mysqladmin-u root password 'new-password'
Replace "new-password" in the command line with the new password ".
Delete anonymous users:
[SQL]
# Mysql-u root-p
Mysql> use mysql
Mysql> delete from user where User = '';
Mysql> quit
When MySQL is installed, it automatically creates two databases. One is the mysql table, which controls the user, host, and DB permissions after the server is put into use. The other is the test database. MySQL's default configuration allows any user to access the system without providing the user name and password.
Reload:
[SQL]
Mysqladmin-u root-p reload
So far, your MySQL can be accessed through PHP Web.
BitsCN.com