mysql命令最新
查看授权
mysql> select user,host from mysql.user; +--------+------------+ | user | host | +--------+------------+ | root | % | | root | 127.0.0.1 | | rep | 172.16.0.% | | rep | 172.16.1.% | | root | ::1 | | | localhost | | backup | localhost | | root | localhost | | | mcw01 | | root | mcw01 | +--------+------------+ 10 rows in set (0.07 sec) mysql> show grants for rep@'172.16.0.%'; +-------------------------------------------------------------------------------------------------------------------------+ | Grants for rep@172.16.0.% | +-------------------------------------------------------------------------------------------------------------------------+ | GRANT REPLICATION SLAVE ON *.* TO 'rep'@'172.16.0.%' IDENTIFIED BY PASSWORD '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9' | +-------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
普通建表,有自增id和主键
CREATE TABLE status ( id INT AUTO_INCREMENT, hosts VARCHAR(30), result VARCHAR(10000), date date, PRIMARY KEY (id) );