我的安装步骤如下:
1. 下载mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz 文件
2.解压_到 /usr/local/mysqlService/目录下 ,解压后的文件夹重命名为mysql
3、运行安装目录下面的 scripts/mysql_install_db 进行安装
4、编辑 /etc/my.cnf 配置如下:
[root@localhost ~]# cat /etc/my.cnf
[client]
socket = /tmp/mysql.sock
[mysqld]
#character-set-server=utf8
datadir=/usr/local/mysqlService/mysql/data
basedir=/usr/local/mysqlService/mysql
socket=/tmp/mysql.sock
Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
Settings user and group are ignored when systemd is used.
If you need to run mysqld under a different user or group,
customize your systemd unit file for mariadb according to the
instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/usr/local/mysqlService/mysql/log/mysqld.log
pid-file=/var/run/mariadb/mariadb.pid
#
include all files from the config directory
#
!includedir /etc/my.cnf.d
[root@localhost ~]#
5、 /etc/my.cnf 中的 socket = /tmp/mysql.sock 是我照着网上写的,我并没有找到mysql.sock 这个文件
6、开始运行 #service mysql start 报错:
170518 17:11:11 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysqlService/mysql/data
2017-05-18 17:11:11 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for m
ore details).
2017-05-18 17:11:11 0 [Note] /usr/local/mysqlService/mysql/bin/mysqld (mysqld 5.6.33) starting as process 27678 ...
2017-05-18 17:11:11 27678 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/mysqlService/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
2017-05-18 17:11:11 27678 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2017-05-18 17:11:11 27678 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-05-18 17:11:11 27678 [Note] InnoDB: The InnoDB memory heap is disabled
2017-05-18 17:11:11 27678 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-05-18 17:11:11 27678 [Note] InnoDB: Memory barrier is not used
2017-05-18 17:11:11 27678 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-05-18 17:11:11 27678 [Note] InnoDB: Using Linux native AIO
2017-05-18 17:11:11 27678 [Note] InnoDB: Using CPU crc32 instructions
2017-05-18 17:11:11 27678 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-05-18 17:11:11 27678 [Note] InnoDB: Completed initialization of buffer pool
2017-05-18 17:11:11 27678 [Note] InnoDB: Highest supported file format is Barracuda.
2017-05-18 17:11:11 27678 [Note] InnoDB: Log scan progressed past the checkpoint lsn 49463
2017-05-18 17:11:11 27678 [Note] InnoDB: Database was not shutdown normally!
2017-05-18 17:11:11 27678 [Note] InnoDB: Starting crash recovery.
2017-05-18 17:11:11 27678 [Note] InnoDB: Reading tablespace information from the .ibd files...
2017-05-18 17:11:11 27678 [Note] InnoDB: Restoring possible half-written data pages
2017-05-18 17:11:11 27678 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1600607
2017-05-18 17:11:11 27678 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 7
4 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
2017-05-18 17:11:12 27678 [Note] InnoDB: 128 rollback segment(s) are active.
2017-05-18 17:11:12 27678 [Note] InnoDB: Waiting for purge to start
2017-05-18 17:11:12 27678 [Note] InnoDB: 5.6.33 started; log sequence number 1600607
2017-05-18 17:11:12 27678 [Note] Server hostname (bind-address): '*'; port: 3306
2017-05-18 17:11:12 27678 [Note] IPv6 is available.
2017-05-18 17:11:12 27678 [Note] - '::' resolves to '::';
2017-05-18 17:11:12 27678 [Note] Server socket created on IP: '::'.
2017-05-18 17:11:12 27678 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
170518 17:11:12 mysqld_safe mysqld from pid file /usr/local/mysqlService/mysql/data/localhost.localdomain.pid ended
到目前为止,一直报这个错误,我目前还觉得是哪里配置出现了问题,但是网上找了一天,一点进展都没有。希望大神们看到能够帮助我解决这个问题。