码迷,mamicode.com
首页 > 数据库 > 详细

mysql之基础操作grant、show、repair、log_error等

时间:2016-04-14 12:29:32      阅读:399      评论:0      收藏:0      [点我收藏+]

标签:mysql grant show repair log_error

grant all on databasename.tablename to ‘username‘@‘xxx.xxx.xxx.xxx‘ identified by ‘complexpassword‘;

grant all on discuz.* to ‘username‘@‘xxx.xxx.xxx.%‘ identified by ‘complexpassword‘;

grant all on discuz.* to ‘username‘@‘%‘ identified by ‘complexpassword‘;

flush privileges;


show processlist;

show variables like "max_connections";


mysql> show variables like "%connect%";

+--------------------------+-------------------+

| Variable_name            | Value             |

+--------------------------+-------------------+

| character_set_connection | latin1            |

| collation_connection     | latin1_swedish_ci |

| connect_timeout          | 10                |

| init_connect             |                   |

| max_connect_errors       | 10                |

| max_connections          | 151               |

| max_user_connections     | 0                 |

+--------------------------+-------------------+

7 rows in set (0.00 sec)


mysql> show variables like "%timeout%";          

+----------------------------+-------+

| Variable_name              | Value |

+----------------------------+-------+

| connect_timeout            | 10    |

| delayed_insert_timeout     | 300   |

| innodb_lock_wait_timeout   | 50    |

| innodb_rollback_on_timeout | OFF   |

| interactive_timeout        | 28800 |

| net_read_timeout           | 30    |

| net_write_timeout          | 60    |

| slave_net_timeout          | 3600  |

| table_lock_wait_timeout    | 50    |

| wait_timeout               | 28800 |

+----------------------------+-------+

10 rows in set (0.00 sec)



mysql> show variables like "%buffer%";       

+-------------------------+---------+

| Variable_name           | Value   |

+-------------------------+---------+

| bulk_insert_buffer_size | 8388608 |

| innodb_buffer_pool_size | 8388608 |

| innodb_log_buffer_size  | 1048576 |

| join_buffer_size        | 131072  |

| key_buffer_size         | 8384512 |

| myisam_sort_buffer_size | 8388608 |

| net_buffer_length       | 16384   |

| preload_buffer_size     | 32768   |

| read_buffer_size        | 131072  |

| read_rnd_buffer_size    | 262144  |

| sort_buffer_size        | 2097144 |

| sql_buffer_result       | OFF     |

+-------------------------+---------+

12 rows in set (0.00 sec)

mysql> show variables like "%err%";      

+--------------------+---------------------+

| Variable_name      | Value               |

+--------------------+---------------------+

| error_count        | 0                   |

| log_error          | /var/log/mysqld.log |

| max_connect_errors | 10                  |

| max_error_count    | 64                  |

| slave_skip_errors  | OFF                 |

+--------------------+---------------------+

5 rows in set (0.00 sec)


mysql> exit

Bye


# cat /etc/my.cnf

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0


[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid


mysql> repair table databasename.tablename;


mysql> repair table discuz.pre_forum_post;

+-----------------------+--------+----------+----------+

| Table                 | Op     | Msg_type | Msg_text |

+-----------------------+--------+----------+----------+

| discuz.pre_forum_post | repair | status   | OK       |

+-----------------------+--------+----------+----------+

1 row in set (0.00 sec)



mysql之基础操作grant、show、repair、log_error等

标签:mysql grant show repair log_error

原文地址:http://shawyang.blog.51cto.com/2894939/1763642

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!