5.7以上版本的mysql安裝(rpm版)
阿新 • • 發佈:2019-02-09
我們以安裝5.7.13 為例
1.安裝順序
2.生成隨機密碼在/var/log/mysqld.log
3.檢視密碼
4. 啟動mysql ,並登入,修改密碼
4.許可權
7. 測試字元亂碼
utf8
如果是預設會報錯
8.如何修改字符集編碼
啟動失敗
日誌
2017-03-16T10:34:11.658379Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended 2017-03-16T10:34:59.145328Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 2017-03-16T10:34:59.347856Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2017-03-16T10:34:59.349428Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.13) starting as process 14918 ... 2017-03-16T10:34:59.354925Z 0 [Note] InnoDB: PUNCH HOLE support available 2017-03-16T10:34:59.354961Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-03-16T10:34:59.354971Z 0 [Note] InnoDB: Uses event mutexes 2017-03-16T10:34:59.354978Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier 2017-03-16T10:34:59.354985Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-03-16T10:34:59.354991Z 0 [Note] InnoDB: Using Linux native AIO 2017-03-16T10:34:59.355249Z 0 [Note] InnoDB: Number of pools: 1 2017-03-16T10:34:59.355370Z 0 [Note] InnoDB: Using CPU crc32 instructions 2017-03-16T10:34:59.357336Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2017-03-16T10:34:59.365656Z 0 [Note] InnoDB: Completed initialization of buffer pool 2017-03-16T10:34:59.367640Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2017-03-16T10:34:59.379574Z 0 [Note] InnoDB: Highest supported file format is Barracuda. 2017-03-16T10:34:59.440318Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2017-03-16T10:34:59.440589Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2017-03-16T10:34:59.729333Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. 2017-03-16T10:34:59.731144Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. 2017-03-16T10:34:59.731180Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. 2017-03-16T10:34:59.732462Z 0 [Note] InnoDB: 5.7.13 started; log sequence number 2539685 2017-03-16T10:34:59.733559Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool 2017-03-16T10:34:59.733979Z 0 [Note] Plugin 'FEDERATED' is disabled. 2017-03-16T10:34:59.734852Z 0 [ERROR] unknown variable 'default-character-set=utf8' 2017-03-16T10:34:59.734885Z 0 [ERROR] Aborting
注意mysqld 是三個一起加上
vi /etc/my.cnf
[mysqld]
default-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci
[client]
default-character-set=utf8
啟動成功