查询mysql当前连接数
1.show status
Threads_connected 当前的连接数
Connections 试图连接到(不管是否成功)MySQL服务器的连接数。
Max_used_connections 服务器启动后已经同时使用的连接的最大数量。
2.set GLOBAL max_connections=连接数;
flush privileges
3.修改/etc/my.cnf中的max_connections
4.show processlist 显示当前正在执行的mysql连
mysql字符集:
mysql> show variables like 'character%';查询当前默认字符集
mysql> show variables like '%profiling%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| have_profiling | YES |
| profiling | OFF |
| profiling_history_size | 15 |
+------------------------+-------+
3 rows in set (0.00 sec)mysql> set global profiling=1; 修改后profiling =ON
修改远程连接的权限:
若要设置root用户可以远程访问,执行
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.30.%' IDENTIFIED BY '123456' WITH GRANT OPTION;