On Unix (Linux), after installing MySQL in accordance with the instructions in the manual, you must run the mysql_install_db script to build the containing authorization
The table's MySQL database and initial permissions. On Windows, run the Setup program in the distribution to initialize the data directory and the MySQL database. False
The server is also running.
When you first install MySQL on a machine, the authorization table in the MySQL database is initialized like this:
You can connect from the local host (localhost) as root without specifying a password. Root user has all permissions (including administrative privileges)
And can do anything about it. (By the way, MySQL Superuser has the same name as the Unix superuser and they have nothing to do with each other.) )
Anonymous access is granted to a database where the user can start with a local connection named Test and any name starting with Test_. Anonymous users can do any of the database
But no administrative rights.
A multi-server connection from the local host is allowed, regardless of whether the connected user uses a localhost hostname or a real host name. Such as:
% mysql-h localhost test
% mysql-h pit.snake.net Test
The fact that your root connection to MySQL doesn't even specify a password simply means that the initial installation is unsafe, so the first thing you need to do as an administrator
Should be to set the root password, and then according to the way you set the password, you can also tell the server Overload authorization table is it know this change
Change. (When the server starts, it overloads the table into memory and may not know that you have modified them.) )
For MySQL 3.22 and later, you can set the password with mysqladmin:
% mysqladmin-u root password yourpassword
For any version of MySQL, you can use the MySQL program and directly modify the user authorization table in the MySQL database:
% mysql-u root MySQL
Mysql>update user SET Password=password ("YourPassword") WHERE user= "root";
If you have an older version of MySQL, use MySQL and update.
After you set the password, check to see if you need to tell the server to overload the authorization table by running the following command:
% mysqladmin-u Root Status
If the server still lets you connect to the server with root without specifying a password, overload the authorization table:
% mysqladmin-u Root Reload
After you have set the root password (and if you need to overload the authorization table), you will need to specify when you connect to the server as root at any time
Password
http://www.bkjia.com/PHPjc/319340.html www.bkjia.com true http://www.bkjia.com/PHPjc/319340.html techarticle On Unix (Linux), after installing MySQL as instructed in the manual, you must run the mysql_install_db script to build the MySQL database with the authorization table and initial permissions. On Windows, run ...