MySQL startup error new authorization

Newly installed mysql version mysql-5.5.56.tar.gz cmake-2.8.6.tar.gz system is centos6.8

Startup error after compiling:

 Starting MySQL..The server quit without updating PID file ([FAILED] al/mysql/data/iZwz92ycxa8b5l94ufhgbcZ.pid).
tail -f /usr/local/mysql/data/iZwz92ycxa8b5l94ufhgbcZ .err 
Check the log file and the following line appears:

180419 12:27:49 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
After consulting the information, we found out. To solve it by typing the following command:

cd  /usr/local/mysql/scripts/
./mysql_install_db –usrer=mysql datadir=/usr/local/mysql

An error occurred:

FATAL ERROR: Could not find ./bin/my_print_defaults   (should exist in the installation mysql directory)

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
 告诉我没有找到 ./bin/my_print_defaults  可在ls -l   bin下有

After that, Baidu has various methods, one of which Xiaobai has not tried to attach the address:

https://blog.csdn.net/m0_37975886/article/details/78329341?locationNum=7&fps=1

Some friends have tried it and hope to tell Xiaobai to study together

 

Another approach I took:

/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data &
 

start up:

[root@iZwz92ycxa8b5l94ufhgbcZ bin]# service mysqld start
Starting MySQL..                                           [  OK  ]
 

Because it is a new installation, change the password directly in admin form mysqladmin -u root password "password"

select host, user from user;
+-------------------------+------+
| host                    | user |
+-------------------------+------+
| 127.0.0.1               | root |
| ::1                     | root |
| izwz92ycxa8b5l94ufhgbcz |      |
| izwz92ycxa8b5l94ufhgbcz | root |
| localhost               |      |
| localhost               | root |
+-------------------------+------

A new authorization is required for a remote connection:

Enter the database:

 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;

(The percent sign can also be replaced with an ip that allows access to be used with iptables)

flush privileges; refresh privileges
 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324944448&siteId=291194637