Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql to view the current database and table | remote access can be configured | View status

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Select database () looks at the current database:

Show tables views the tables in the current database

Configure that the remote mysql server can be accessed:

Find bind-address = 127.0.0.1 at / etc/mysql/mysql.conf.d/mysqld.cnf

Comment out this line, for example: # bind-address = 127.0.0.1

Or change it to: bind-address = 0.0.0.0

Allow arbitrary IP acc

Or specify an IP address yourself.

Restart / etc/init.d/mysql restart

Authorized users can connect remotely

Grant all privileges on. To root@ "" identified by "password" with grant option

Flush privileges

The first command: the first represents the database name; the second represents the table name, and all tables in the database are authorized to root. "%": indicates that the authorized user IP can be specified, which means that any IP address can access the MySQL database according to the specified password "password".

The second line of command is to refresh the permission information, that is, to make the settings take effect immediately.

Check whether mysql is started under linux:

Use the command # service mysqld status or # service mysql status command to view the startup status of mysql

If it is mysqld is stopped, it means that the mysql service is stopped.

If it is mysqld is running, it means that the mysql service is started.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report