注意事项
生产环境,使用命令行来连接mysql服务器的时候,要注意,尽量不要使用
mysql -u用户 -p密码
,因为这样会导致密码泄露。而是使用
mysql -h$ip -P$port -u$user -p
例如
C:\Users\Yushuzi>mysql -hlocalhost -P3306 -uroot -p
Enter password: *********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.7.19-log MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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>