MySQL database is not visible after Linux server is installed on MySQL

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.