目前分類:MySQL (8)

瀏覽方式: 標題列表 簡短摘要
  • 這是一篇限定共同作者觀看的文章。
    若您是共同作者,登入後即可閱讀。

建立cacti資料庫
[root@localhost ~]#mysqladmin --user=root create cacti

里歐 發表在 痞客邦 留言(0) 人氣()

For this exercise, we will use the mysqldump utility the same as if we were 

Syntax:

里歐 發表在 痞客邦 留言(0) 人氣()

For every database, you should set the root or sa passwords to something other than the default, unless you want to get hacked. For mysql, the system administrator user is called root. You will use the mysqladmin utility from a command line to set the new password. Notice that there are two commands to be run.

Syntax:

里歐 發表在 痞客邦 留言(0) 人氣()

There are many reasons you would want to restore a database from a backup file… But you should also test this on a test server just to make sure that your database backups are working correctly. Here’s the syntax:

mysql -h hostname -u username -pthepassword databasename < dumpfile.sql

里歐 發表在 痞客邦 留言(0) 人氣()

Backing up your database is a very important system administration task, and should generally be run from a cron job at scheduled intervals. We will use the mysqldump utility included with mysql to dump the contents of the database to a text file that can be easily re-imported.

Syntax:

里歐 發表在 痞客邦 留言(0) 人氣()

利用mysqlcheck命令快速修復mysql資料庫 

     因為掉電或者其他原因導致資料庫損壞,我們可以使用mysql本身的mysqlcheck命令來快速修復所有的資料庫或者特定的資料庫;

里歐 發表在 痞客邦 留言(0) 人氣()

Automatically Purge MySQL Master Log
My Friend Andre Hartawan is troubling due to his mysql server at work stop operating. After quick check he found that no more disk space available on the system. Further check on /var partition he found many replication log file on disk which no longer needed but have big size (100MB). He can easily purge the logs file but wanted the server due it chores automatically. So here it’s I share my script (autopurgebinlog.sh) to purge replication logbin automatically.

里歐 發表在 痞客邦 留言(0) 人氣()