docker安装MySQL 8.0及初始化错误处理

2018-06-26 01:10:30来源:博客园 阅读 ()

新老客户大回馈,云服务器低至5折

 
Preface
    
    Several days ago,I've implement a docker environmnet,I'm gonna Install a MySQL 8.0 version on it.Let's see the detail of it.
 
Procedure
 
Check and run docker container again.
 1 [root@docker vagrant]# docker images
 2 REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
 3 centos7             latest              7d0b68af5a06        10 days ago         694MB
 4 [root@docker vagrant]# docker run -d -v /vagrant/mysql_soft:/opt/mysql -v /vagrant/data1:/data -v /etc/hosts:/etc/hosts -p2222:22 --cap-add=NET_ADMIN --name c1 -h docker centos7
 5 fbf17e3f6aa8324b8d494aa0211122f5d735bf6f648a99b6632ae2be5be996da
 6 [root@docker vagrant]# docker ps -a
 7 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                     PORTS                  NAMES
 8 fbf17e3f6aa8        centos7             "/usr/bin/supervisor…"   5 seconds ago       Up 3 seconds (healthy)     0.0.0.0:2222->22/tcp   c1
 9 103f318448c9        centos7             "/usr/bin/supervisor…"   25 minutes ago      Exited (0) 3 minutes ago                          node1
10 [root@docker vagrant]# docker rm container 103f318448c9
11 103f318448c9
12 Error: No such container: container
13 [root@docker vagrant]# docker ps
14 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                    PORTS                  NAMES
15 fbf17e3f6aa8        centos7             "/usr/bin/supervisor…"   32 seconds ago      Up 30 seconds (healthy)   0.0.0.0:2222->22/tcp   c1
16 [root@docker vagrant]# ssh root@172.17.0.2
17 root@172.17.0.2's password: 
18 Last login: Wed Jun 13 00:18:11 2018 from 172.17.0.1
19 [root@docker ~]# df -h
20 Filesystem                                                                                          Size  Used Avail Use% Mounted on
21 /dev/mapper/docker-253:0-16777839-60de86a769f75e2e96c849e76f1b3de10ac8c8d9985597ff3f758070edada54d   10G  682M  9.4G   7% /
22 tmpfs                                                                                                64M     0   64M   0% /dev
23 tmpfs                                                                                               497M     0  497M   0% /sys/fs/cgroup
24 none                                                                                                612G  242G  370G  40% /data
25 /dev/mapper/centos-root                                                                             8.4G  2.1G  6.3G  26% /etc/hosts
26 shm                                                                                                  64M     0   64M   0% /dev/shm
27 tmpfs                                                                                               497M     0  497M   0% /proc/scsi
28 tmpfs                                                                                               497M     0  497M   0% /sys/firmware

 

Download and extract MySQL software.

 1 [root@docker ~]# cd /vagrant/mysql_soft
 2 [root@docker mysql_soft]# wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz
 3 [root@docker mysql_soft]# cd /opt/mysql
 4 [root@docker mysql]# ls -l
 5 total 1215644
 6 -rwxrwxrwx 1 1000 1000 641798603 Mar 18 21:32 mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz
 7 -rwxrwxrwx 1 1000 1000 603019898 Jun 19 00:42 mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz
 8 [root@docker mysql]# tar -zxf mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz 
 9 tar: mysql-8.0.11-linux-glibc2.12-x86_64/lib/libcrypto.so: Cannot create symlink to `libcrypto.so.1.0.0': Protocol error
10 tar: mysql-8.0.11-linux-glibc2.12-x86_64/lib/libmysqlclient.so: Cannot create symlink to `libmysqlclient.so.21': Protocol error
11 tar: mysql-8.0.11-linux-glibc2.12-x86_64/lib/libmysqlclient.so.21: Cannot create symlink to `libmysqlclient.so.21.0.11': Protocol error
12 tar: mysql-8.0.11-linux-glibc2.12-x86_64/lib/libssl.so: Cannot create symlink to `libssl.so.1.0.0': Protocol error
13 tar: mysql-8.0.11-linux-glibc2.12-x86_64/lib/plugin/libssl.so.1.0.0: Cannot create symlink to `../../lib/libssl.so.1.0.0': Protocol error
14 tar: mysql-8.0.11-linux-glibc2.12-x86_64/lib/plugin/libcrypto.so.1.0.0: Cannot create symlink to `../../lib/libcrypto.so.1.0.0': Protocol error
15 tar: mysql-8.0.11-linux-glibc2.12-x86_64/lib/plugin/debug/libssl.so.1.0.0: Cannot create symlink to `../../../lib/libssl.so.1.0.0': Protocol error
16 tar: mysql-8.0.11-linux-glibc2.12-x86_64/lib/plugin/debug/libcrypto.so.1.0.0: Cannot create symlink to `../../../lib/libcrypto.so.1.0.0': Protocol error
17 tar: mysql-8.0.11-linux-glibc2.12-x86_64/bin/libssl.so.1.0.0: Cannot create symlink to `../lib/libssl.so.1.0.0': Protocol error
18 tar: mysql-8.0.11-linux-glibc2.12-x86_64/bin/libcrypto.so.1.0.0: Cannot create symlink to `../lib/libcrypto.so.1.0.0': Protocol error
19 tar: Exiting with failure status due to previous errors

 

Check absent "libxxx.so" then install them untill there're no "not found" results.

 1 [root@docker mysql]# ldd /usr/local/mysql/bin/mysqld.sh
 2 ldd: /usr/local/mysql/bin/mysqld.sh: No such file or directory
 3 [root@docker mysql]# ldd /usr/local/mysql/bin/mysqld
 4     linux-vdso.so.1 =>  (0x00007fff57cca000)
 5     libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f57bc85d000)
 6     libaio.so.1 => not found
 7     libnuma.so.1 => not found
 8     libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f57bc625000)
 9     libssl.so.1.0.0 => not found
10     libcrypto.so.1.0.0 => not found
11     libdl.so.2 => /lib64/libdl.so.2 (0x00007f57bc420000)
12     librt.so.1 => /lib64/librt.so.1 (0x00007f57bc217000)
13     libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f57bbf10000)
14     libm.so.6 => /lib64/libm.so.6 (0x00007f57bbc0e000)
15     libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f57bb9f7000)
16     libc.so.6 => /lib64/libc.so.6 (0x00007f57bb62a000)
17     /lib64/ld-linux-x86-64.so.2 (0x00007f57bca7f000)
18     libfreebl3.so => /lib64/libfreebl3.so (0x00007f57bb427000)
19 [root@docker mysql]# yum install -y libaio numactl libssl libcrypto
20 -- Omitted
21 [root@docker mysql]# ldd /usr/local/mysql/bin/mysqld
22     linux-vdso.so.1 =>  (0x00007fff05f82000)
23     libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc18aca3000)
24     libaio.so.1 => /lib64/libaio.so.1 (0x00007fc18aaa0000)
25     libnuma.so.1 => /lib64/libnuma.so.1 (0x00007fc18a894000)
26     libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fc18a65d000)
27     libssl.so.1.0.0 => not found
28     libcrypto.so.1.0.0 => not found
29     libdl.so.2 => /lib64/libdl.so.2 (0x00007fc18a458000)
30     librt.so.1 => /lib64/librt.so.1 (0x00007fc18a24f000)
31     libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc189f48000)
32     libm.so.6 => /lib64/libm.so.6 (0x00007fc189c46000)
33     libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc189a2f000)
34     libc.so.6 => /lib64/libc.so.6 (0x00007fc189662000)
35     /lib64/ld-linux-x86-64.so.2 (0x00007fc18aec5000)
36     libfreebl3.so => /lib64/libfreebl3.so (0x00007fc18945f000)
37 [root@docker mysql]# find / -name libssl.so.1.0.0
38 /opt/mysql/mysql-8.0.11-linux-glibc2.12-x86_64/lib/libssl.so.1.0.0
39 [root@docker mysql]# cp /opt/mysql/mysql-8.0.11-linux-glibc2.12-x86_64/lib/libssl.so.1.0.0 /usr/lib64
40 [root@docker mysql]# find / -name libcrypto.so.1.0.0
41 /opt/mysql/mysql-8.0.11-linux-glibc2.12-x86_64/lib/libcrypto.so.1.0.0
42 [root@docker mysql]# cp /opt/mysql/mysql-8.0.11-linux-glibc2.12-x86_64/lib/libcrypto.so.1.0.0 /usr/lib64
43 [root@docker mysql]# ldd /usr/local/mysql/bin/mysqld
44     linux-vdso.so.1 =>  (0x00007fff13ffe000)
45     libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f156dbc3000)
46     libaio.so.1 => /lib64/libaio.so.1 (0x00007f156d9c0000)
47     libnuma.so.1 => /lib64/libnuma.so.1 (0x00007f156d7b4000)
48     libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f156d57d000)
49     libssl.so.1.0.0 => /lib64/libssl.so.1.0.0 (0x00007f156d30d000)
50     libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 (0x00007f156cf25000)
51     libdl.so.2 => /lib64/libdl.so.2 (0x00007f156cd21000)
52     librt.so.1 => /lib64/librt.so.1 (0x00007f156cb18000)
53     libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f156c811000)
54     libm.so.6 => /lib64/libm.so.6 (0x00007f156c50f000)
55     libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f156c2f8000)
56     libc.so.6 => /lib64/libc.so.6 (0x00007f156bf2b000)
57     /lib64/ld-linux-x86-64.so.2 (0x00007f156dde5000)
58     libfreebl3.so => /lib64/libfreebl3.so (0x00007f156bd28000)

 

Make required directory and create soft link.

1 [root@docker mysql]# mkdir -p /data/mysql/mysql3306/{data,logs,tmp}
2 [root@docker mysql]# ln -sv /opt/mysql/mysql-8.0.11-linux-glibc2.12-x86_64 /usr/local/mysql
3 ‘/usr/local/mysql’ -> ‘/opt/mysql/mysql-8.0.11-linux-glibc2.12-x86_64’

 

Create mysql group & user.

1 [root@docker mysql]# userdel mysql
2 [root@docker mysql]# groupadd mysql
3 [root@docker mysql]# useradd -g mysql -s /sbin/nologin -d /usr/local/mysql -MN mysql

 

Modify directory privilege.

1 [root@docker mysql]# cd /usr/local
2 [root@docker local]# chown -R mysql.mysql mysql

 

Modify environment variable.

1 [root@docker local]# echo "export PATH=$PATH:/usr/local/mysql/bin" >> ~/.bash_profile
2 [root@docker local]# source ~/.bash_profile
3 [root@docker local]# echo $PATH
4 /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin

 

Prepare a suitable my.cnf in docker and then copy it to specific path.

1 [root@docker local]# cp /opt/mysql/my.cnf /data/mysql/mysql3306/my3306.cnf

 

Initialize MySQL db.

[root@docker local]# mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf --initialize
mysqld: [Warning] World-writable config file '/data/mysql/mysql3306/my3306.cnf' is ignored.
2018-06-23T16:26:39.446641Z 0 [System] [MY-013169] [Server] mysqld (mysqld 8.0.11) initializing of server in progress as process 20451
2018-06-23T16:26:39.528638Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file '/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2018-06-23T16:26:39.804315Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2018-06-23T16:26:39.804363Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-06-23T16:26:40.010408Z 0 [System] [MY-010910] [Server] mysqld: Shutdown complete (mysqld 8.0.11)  MySQL Community Server - GPL.
[root@docker ~]# cd /data/mysql/mysql3306/data -- There're no files in the directory,why does it show the existent error?Let's see below.
[root@docker data]# ls -la
total 4
drwxrwxrwx 1 mysql mysql    0 Jun 19 03:24 .
drwxrwxrwx 1 mysql mysql 4096 Jun 24 00:38 ..

 

I change the way of initialization.

1 [root@docker data]# mysqld --basedir=/usr/local/mysql --datadir=/data/mysql/mysql3306/data --user=mysql --initialize
2 2018-06-23T17:04:01.792594Z 0 [System] [MY-013169] [Server] mysqld (mysqld 8.0.11) initializing of server in progress as process 12261
3 2018-06-23T17:04:01.887954Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /data/mysql/mysql3306/data/ is case insensitive
4 mbind: Operation not permitted
5 2018-06-23T17:04:12.669761Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: o/>k*hqxn1T=
6 2018-06-23T17:04:16.807974Z 0 [System] [MY-013170] [Server] mysqld (mysqld 8.0.11) initializing of server has completed
7 [root@docker etc]# ps aux | grep mysqld
8 root     13712  0.0  0.0  10692   976 pts/1    SN+  01:06   0:00 grep --color=auto mysqld

 

Start mysqld but failed.

 1 [root@docker etc]# mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf &
 2 [1] 14145
 3 [root@docker etc]# mysqld: [Warning] World-writable config file '/data/mysql/mysql3306/my3306.cnf' is ignored.
 4 2018-06-23T17:06:54.345108Z 0 [System] [MY-010116] [Server] mysqld (mysqld 8.0.11) starting as process 14145
 5 2018-06-23T17:06:54.346090Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file '/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
 6 2018-06-23T17:06:54.357718Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /data/ is case insensitive
 7 2018-06-23T17:06:54.358228Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
 8 2018-06-23T17:06:54.358263Z 0 [ERROR] [MY-010119] [Server] Aborting
 9 2018-06-23T17:06:54.362713Z 0 [System] [MY-010910] [Server] mysqld: Shutdown complete (mysqld 8.0.11)  MySQL Community Server - GPL.
10 ^C
11 [1]+  Exit 1                  mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf

 

The my3306.cnf cannot be world-writable,so I copy it to "/tmp" and start mysqld again.

 1 [root@docker etc]# cp /data/mysql/mysql3306/my3306.cnf /tmp
 2 [root@docker etc]# cd /tmp
 3 [root@docker tmp]# ls -l | grep my3306.cnf
 4 -rwxr-xr-x 1 root root 9672 Jun 24 01:10 my3306.cnf
 5 [root@docker tmp]# mysqld --defaults-file=/tmp/my3306.cnf &
 6 [1] 16816
 7 [root@docker tmp]# ps aux | grep mysqld
 8 root     16926  0.0  0.0  10692   976 pts/1    SN+  01:11   0:00 grep --color=auto mysqld
 9 [1]+  Exit 1                  mysqld --defaults-file=/tmp/my3306.cnf
10 [root@docker etc]# tail /data/mysql/mysql3306/data/error.log
11 2018-06-24T01:11:03.732865+08:00 0 [Warning] [MY-010086] [Server] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
12 2018-06-24T01:11:03.735145+08:00 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
13 2018-06-24T01:11:03.736465+08:00 0 [System] [MY-010116] [Server] mysqld (mysqld 8.0.11) starting as process 16816
14 mbind: Operation not permitted
15 2018-06-24T01:11:04.184074+08:00 1 [ERROR] [MY-012263] [InnoDB] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 768 pages (rounded down to MB) than specified in the .cnf file: initial 6400 pages, max 0 (relevant if non-zero) pages!
16 2018-06-24T01:11:04.184868+08:00 1 [ERROR] [MY-012930] [InnoDB] InnoDB: Plugin initialization aborted with error Generic error.
17 2018-06-24T01:11:04.810086+08:00 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
18 2018-06-24T01:11:04.810840+08:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
19 2018-06-24T01:11:04.810961+08:00 0 [ERROR] [MY-010119] [Server] Aborting
20 2018-06-24T01:11:04.828841+08:00 0 [System] [MY-010910] [Server] mysqld: Shutdown complete (mysqld 8.0.11)  MySQL Community Server - GPL.

 

It still has problem 'cause size of "./ibdata1" is incompatible with the parameter in "my3306.cnf".

1 [root@docker data]# ls -l ibdata1
2 -rwxrwxrwx 1 mysql mysql 12582912 Jun 24 01:04 ibdata1
3 [root@docker data]# cat /tmp/my3306.cnf | grep innodb_data_file_path
4 innodb_data_file_path                           =ibdata1:100M:autoextend    #    ibdata1:12M:autoextend
5 [root@docker data]# vim /tmp/my3306.cnf | grep innodb_data_file_path
6 [root@docker data]# cat /tmp/my3306.cnf | grep innodb_data_file_path
7 innodb_data_file_path                           =ibdata1:12M:autoextend    #    ibdata1:12M:autoextend

 

After I started mysqld several seconds later,the process down again at once.

 1 [root@docker etc]# mysqld --defaults-file=/tmp/my3306.cnf &
 2 [1] 4761
 3 [root@docker etc]# ps aux|grep mysqld
 4 mysql     4761 38.0  3.1 474908 32152 pts/1    SNl  01:42   0:01 mysqld --defaults-file=/tmp/my3306.cnf
 5 root      4808  0.0  0.0  10692   972 pts/1    SN+  01:42   0:00 grep --color=auto mysqld
 6 [root@docker etc]# ps aux|grep mysqld
 7 root      6964  0.0  0.0  10692   972 pts/1    SN+  01:45   0:00 grep --color=auto mysqld
 8 [root@docker etc]# 
 9 [root@docker data]# tail -10 error.log
10 2018-06-24T01:42:30.177384+08:00 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
11 2018-06-24T01:42:30.179005+08:00 0 [System] [MY-010116] [Server] mysqld (mysqld 8.0.11) starting as process 4761
12 mbind: Operation not permitted
13  100
14  100
15  100
16 2018-06-24T01:42:33.215591+08:00 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('1') and data dictionary ('2').
17 2018-06-24T01:42:33.216211+08:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
18 2018-06-24T01:42:33.216289+08:00 0 [ERROR] [MY-010119] [Server] Aborting
19 2018-06-24T01:42:34.839683+08:00 0 [System] [MY-010910] [Server] mysqld: Shutdown complete (mysqld 8.0.11)  MySQL Community Server - GPL.

 

The error shows that the value is not equal between "lower_case_table_names" and dictionary.

1 [root@docker data]# cat /opt/mysql/my.cnf|grep lower_case_table_names
2 lower_case_table_names              =1                              #    0
3 [root@docker data]# cat /tmp/my3306.cnf | grep lower_case_table_names
4 lower_case_table_names              =1                              #    0
5 [root@docker data]# vim /tmp/my3306.cnf 
6 [root@docker data]# cat /tmp/my3306.cnf | grep lower_case_table_names
7 lower_case_table_names              =2                              #    0

 

After I've modified my3306.cnf,it seems no error occurs now.

 1 [root@docker data]# tail -10 error.log
 2 2018-06-24T01:53:20.035831+08:00 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode.
 3 2018-06-24T01:53:20.035971+08:00 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
 4 2018-06-24T01:53:20.036064+08:00 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
 5 2018-06-24T01:53:20.036160+08:00 0 [Warning] [MY-010315] [Server] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
 6 2018-06-24T01:53:20.036898+08:00 0 [Warning] [MY-010323] [Server] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
 7 2018-06-24T01:53:20.037083+08:00 0 [Warning] [MY-010323] [Server] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
 8 2018-06-24T01:53:20.037268+08:00 0 [Warning] [MY-010311] [Server] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
 9 2018-06-24T01:53:20.042517+08:00 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
10 2018-06-24T01:53:20.042646+08:00 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
11 2018-06-24T01:53:20.099046+08:00 0 [System] [MY-010931] [Server] mysqld: ready for connections. Version: '8.0.11'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server - GPL.
12 [root@docker etc]# ps aux|grep mysqld
13 mysql    11812  2.0  9.3 1148688 95244 pts/1   SNl  01:53   0:01 mysqld --defaults-file=/tmp/my3306.cnf
14 root     12514  0.0  0.0  10692   972 pts/1    SN+  01:54   0:00 grep --color=auto mysqld

 

Start mysql client and modify the password generated by initialization.

 1 [root@docker etc]# mysql
 2 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
 3 [root@docker etc]# mysql -p
 4 Enter password: -- Use the password which generated by initialization(here is "o/>k*hqxn1T=")
 5 Welcome to the MySQL monitor.  Commands end with ; or \g.
 6 Your MySQL connection id is 9
 7 Server version: 8.0.11
 8 
 9 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
10 
11 Oracle is a registered trademark of Oracle Corporation and/or its
12 affiliates. Other names may be trademarks of their respective
13 owners.
14 
15 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
16 
17 mysql> show databases;
18 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
19 mysql> alter user root@localhost identified by 'Passw0rd';
20 Query OK, 0 rows affected (0.11 sec)
21 
22 mysql> show databases;
23 +--------------------+
24 | Database           |
25 +--------------------+
26 | information_schema |
27 | mysql              |
28 | performance_schema |
29 | sys                |
30 +--------------------+
31 4 rows in set (0.20 sec)
32 
33 mysql>

 

Summary
  • ldd can be used to check if mysqld is missing "libxxx.so" file.Then you can install or copy directly into "/usr/lib64" directory.
  • There're many errors in my installation procedure due to inappropriate parameters.
  • Because of the vagrant,all the shared directories in docker contains also has the 777 privilege what cause the world-writable issue.
  • Since MySQL 5.7,password of root@localhost must be changed while first login.Otherwise,you can do nothing at all.

 

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:MariaDB初始化和启动故障

下一篇:数据表查询1