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

來源:互聯網
上載者:User

標籤: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等

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.