作為一名Linux運維工程師,MYSQL知識點的掌握將對求職面試有幫助。接下來將介紹幾道Linux運維MYSQL面試題,幫助大家提升面試水平。
1.如何查看MYSQL數據庫的版本?
mysql --version
2.如何備份MYSQL數據庫?
mysqldump -u username -p database >backup_file.sql
3.如何恢復MYSQL數據庫?
mysql -u username -p database< backup_file.sql
4.如何查詢MYSQL中所有表的大小?
SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema.TABLES WHERE table_schema = "database_name" ORDER BY (data_length + index_length) DESC;
5.如何查詢MYSQL中所有表的行數?
SELECT table_name AS “Table”, table_rows AS “Count” FROM information_schema.TABLES WHERE table_schema = “db_name”;
6.如何查看MYSQL的請求數?
SHOW GLOBAL STATUS LIKE ‘Questions’;
7.MYSQL如何啟動和停止?
/etc/init.d/mysql start/stop 或: service mysql start/stop
8.如何設置MYSQL的最大連接數?
在/etc/my.cnf文件中添加: max_connections=1000
文章到此結束,以上就是幾個常見的Linux運維MYSQL面試題。希望對大家有所幫助。