linuxidc@leaf:/usr/local/mysql$ sudo bin/mysqladmin version
bin/mysqladmin Ver 8.42 Distrib 5.6.28, for linux-glibc2.5 on x86_64
Copyright (c) 2000, 2015, 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.
Server version 5.6.28
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 8 min 36 sec
Threads: 1 Questions: 2 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables: 60 Queries per second avg: 0.003
成功了!然后我们再进行下面的操作热热身吧:
#通过mysqladmin关闭mysql服务
linuxidc@leaf:/usr/local/mysql$ sudo bin/mysqladmin -u root shutdown
#启动mysql服务
linuxidc@leaf:/usr/local/mysql$ sudo bin/mysqld_safe --user=mysql &
#查看mysql数据库中默认存在的数据库
linuxidc@leaf:/usr/local/mysql$ sudo bin/mysqlshow
+--------------------+
| Databases |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
#查看mysql数据库(注意此mysql数据库是一个实体,与上面的统称不同)中的数据表
linuxidc@leaf:/usr/local/mysql$ sudo bin/mysqlshow mysql
Database: mysql
+---------------------------+
| Tables |
+---------------------------+
| columns_priv |
| db |
| event |
| func |
| general_log |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| innodb_index_stats |
| innodb_table_stats |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| proxies_priv |
| servers |
| slave_master_info |
| slave_relay_log_info |
| slave_worker_info |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
#查看mysql数据库中的所有user表
linuxidc@leaf:/usr/local/mysql$ sudo bin/mysql -e "SELECT User, Host, plugin FROM mysql.user" mysql
+------+-----------+-----------------------+
| User | Host | plugin |
+------+-----------+-----------------------+
| root | localhost | mysql_native_password |
| root | leaf | mysql_native_password |
| root | 127.0.0.1 | mysql_native_password |
| root | ::1 | mysql_native_password |
| | localhost | mysql_native_password |
| | leaf | mysql_native_password |
+------+-----------+-----------------------+
需要注意的是,上面的这些测试必须要在你已经启动了mysql服务的情况下才去进行操作。同时,如果想知道每一步的详细解释,可以参考官方文档:
准确来讲,MySQL是已经成功安装完成了!下面我们再做一些基础的优化,主要是从安全的角度去考虑。