【正文】
WITH GRANT OPTION。mysql flush privileges。help。uroot 配置解釋:DCMAKE_INSTALL_PREFIX=/usr/local/mysql 設置安裝目錄 DMYSQL_DATADIR=/home/mysql/data 設置數(shù)據(jù)庫存放目錄 DMYSQL_UNIX_ADDR=/usr/local/mysql/ 設置 UNIX socket 目錄DMYSQL_USER=mysql 設置運行用戶DDEFAULT_CHARSET=utf8 設置默認字符集,默認 latin1 DEFAULT_COLLATION=utf8_general_ci 設置默認校對規(guī)則,默認 latin1_general_ciDWITH_INNOBASE_STORAGE_ENGINE=1 添加 InnoDB 引擎支持DENABLE_DOWNLOADS=1 自動下載可選文件,比如自動下載谷歌的測試包DMYSQL_TCP_PORT=3306 設置服務器監(jiān)聽端口,默認 3306DSYSCONFDIR=/etc 設置 所在目錄,默認為安裝目錄) 執(zhí)行過程中會出現(xiàn): CMake Error: Problem with tar_extract_all(): Invalid argument?CMake Error: Problem extracting tar: /usr/local/src/解決方法:cd mysql 目錄下面會發(fā)現(xiàn)有一個 source_downloads 目錄,需要解壓 unzip ,然 后再重新執(zhí)行上述配置過程。root39。mysqlGRANT ALL PRIVILEGES ON *.* TO 39。 WITH GRANT OPTION。 thatanyone can access. This is also intended only for testing,and should be removed before moving into a productionenvironment.Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y 刪除 test 庫及相應權(quán)限 Dropping test database...Success. Removing privileges on test database...Success.Reloading the privilege tables will ensure that all changesmade so far will take effect immediately.Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y 重新加載權(quán)限表使設置生效 Success.All done!2重啟服務器,檢測 mysql 是否能開機自動啟動:[rootcpmysql01 ~] reboot 。 IDENTIFIED BY 39。++| Database |++| information_schema || mysql || performance_schema || sys |++4 rows in set ( sec)mysql use mysql。 mysql flush privileges。正式生產(chǎn)環(huán) 境,建議數(shù)據(jù)目錄和日志目錄都使用單獨的分區(qū)來掛載,不同分區(qū)屬于不同的磁盤或磁盤 組。39。 or 39。 注意:真實生產(chǎn)環(huán)境,應用操作不要使用 root 用戶。defaultcharacterset=utf839。 IDENTIFIED BY 39。39。2登錄并修改 MySQL 用戶 root 的密碼: mysql uroot p?Enter password: Wele to the MySQL monitor. Commands end with 。SET NAMES utf839。修改/etc/ 操作如下:可以:mv /etc/ /etc/也可以:刪除掉/etc/