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

Examples of mysql_config_editor usage

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Mysql_config_editor is a tool for storing mysql login information.

After setting the login information through mysql_config_editor, you can add only one parameter-- login-path=name when you log in to the database with the mysql command.

Instead of entering host,user,password and other information to log in.

Examples are as follows:

Normal login is as follows:

# mysql-uroot-pendant 123456'-socket=/tmp/mysql.sock

Configure config_editor:

# mysql_config_editor set-login-path=9527-socket=/tmp/mysql.sock-user=root-password

Enter password:-- enter 123456 at this time

Print config_editor information:

# mysql_config_editor print-all

[9527]

User = root

Password = *

Socket = / tmp/mysql.sock

Log in with mysql-login-path:

# mysql-login-path=9527

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 66820

Server version: 8.0.13 MySQL Community Server-GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

Affiliates. Other names may be trademarks of their respective

Owners.

Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.

Mysql >\ s

-

Mysql Ver 8.0.13 for linux-glibc2.12 on x8634 (MySQL Community Server-GPL)

Connection id: 66820

Current database:

Current user: root@localhost

SSL: Not in use

Current pager: stdout

Using outfile:''

Using delimiter:

Server version: 8.0.13 MySQL Community Server-GPL

Protocol version: 10

Connection: Localhost via UNIX socket

Server characterset: utf8mb4

Db characterset: utf8mb4

Client characterset: utf8mb4

Conn. Characterset: utf8mb4

UNIX socket: / tmp/mysql.sock

Uptime: 23 hours 41 min 42 sec

Threads: 2 Questions: 266 Slow queries: 0 Opens: 380 Flush tables: 2 Open tables: 352 Queries per second avg: 0.003

-

Mysql > quit

Bye

Reset deletes all the contents of the config_editor log

# mysql_config_editor reset

Do not prompt for password methods when developing shell scripts:

# cd ~

# vim .my.cnf

[client]

User=root

Password=123456

You can log in directly by tapping mysql without entering a password:

# mysql

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 132246

Server version: 8.0.13 MySQL Community Server-GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

Affiliates. Other names may be trademarks of their respective

Owners.

Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.

Mysql > quit

Bye

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