This question haunts me for a few hours to see the problem.
Summary sentence: Permission issues. How do you authorize that?
First step: Stop service
Command line:
/etc/init.d/mysql stop
If not, execute the next line:
Service Mysqld Stop
Reported
Stopping mysqld: [OK]
Step Two: Skip password verification
To execute a command line:
#/usr/bin/mysqld_safe--skip-grant-tables
Reported
151104 09:07:56 mysqld_safe Logging to '/var/lib/mysql/iz23dq2wm0jz.err '.
151104 09:07:56 Mysqld_safe starting mysqld daemon with databases From/var/lib/mysql
Step three: no password login
To execute a command line:
Mysql-u Root
Fourth step: Authorize
mysql>Grant all privileges in *.* to ' root ' @ ' localhost ' identified by ' root ' with GRANT option;
Keyword Explanation:
Root ' @ ' localhost: is a user
Root: Is the password
Problem one: No password conditions, no authorization to write permission
The MySQL server is running with the--skip-grant-tables option so it cannot execute this statement
Workaround:
Mysql> Set global read_only=0;//(turn off the read-only property of the new home library)
Mysql>flush privileges;
Mysql>set Global read_only=1;//(read-write properties)
mysql>flush privileges; strong> (note refresh is mandatory)
Step Fifth: Restart the database
Service mysqld Stop
Report:
stopping mysqld: [ ok ]
Service mysqld start
Report:
starting mysqld: [ ok ]
or
service mysqld restart