Reference Link: https://www.cnblogs.com/ThinkVenus/p/7670722.html
After entering the database, you can only see information_schema/test these two libraries, the other databases are not visible, this is a problem with permissions.
Turn off MySQL, perform service mysql stop
Start MySQL in safe mode, if you manually install the Mysql,mysqld_safe command through the tar package under "${mysql}/bin"
Mysqld_safe--skip-grant-tables
After executing this command, the current SSH command line stops, as
Open an SSH connection and log in to the MySQL database
Mysql
Modifying the Mysql.user table
UseMySQL;Delete from`User`;INSERT into`User' (' Host ', 'User', ' Password ', ' select_priv ', ' insert_priv ', ' update_priv ', ' delete_priv ', ' create_priv ', ' drop_priv ', ' reload_priv ', ' Shutdown_priv ', ' process_priv ', ' file_priv ', ' grant_priv ', ' references_priv ', ' index_priv ', ' alter_priv ', ' Show_db_ Priv ', ' super_priv ', ' create_tmp_table_priv ', ' lock_tables_priv ', ' execute_priv ', ' repl_slave_priv ', ' Repl_client_ ' Priv ', ' create_view_priv ', ' show_view_priv ', ' create_routine_priv ', ' alter_routine_priv ', ' create_user_priv ', ' Event _priv ', ' trigger_priv ', ' create_tablespace_priv ', ' ssl_type ', ' ssl_cipher ', ' x509_issuer ', ' x509_subject ', ' max_ Questions ', ' max_updates ', ' max_connections ', ' max_user_connections ', ' plugin ', ' authentication_string ')VALUES ('%','Root',"','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"',"',"',"',0,0,0,0,"',"'),('127.0.0.1','Root',"','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"',"',"',"',0,0,0,0,"',"'), (':: 1','Root',"','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"',"',"',"',0,0,0,0,"',"'), ('localhost',"',"','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"',"',"',"',0,0,0,0,"',"');
Restart Mysql:service mysql Restart
After startup, log in to the MySQL database, you can see all the databases properly.
Set MySQL password: Go to the MySQL bin directory,./mysqladmin-u root password ' password '
Modify Password command:
Outside the MySQL system, use the Mysql/bin/mysqladmin
# mysqladmin-u root-p password "test123"
Enter Password: "Enter the original password"
MySQL database is not visible after Linux server is installed on MySQL