一、软件下载
登录到
http://dev.mysql.com/downloads/mysql/
,选择对应的版本进行下载。
二、创建mysql 用户
[root@localhost ~]# groupadd mysql
[root@localhost ~]# useradd -g mysql mysql
[root@localhost ~]# passwd mysql
将tar 包拷贝到mysql的home 目录下,进行解压后得到的目录 重命名为 mysql-5.7.9
三、安装数据库
进入 /mysql/mysql5.7/bin
[mysql@localhost bin]$ ./mysql_install_db –user=mysql –basedir=/mysql/mysql5.7 –datadir=/mysql/mysql5.7/data
2017-04-19 06:49:00 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld –initialize
2017-04-19 06:49:07 [ERROR] The bootstrap log isn’t empty:
2017-04-19 06:49:07 [ERROR] 2017-04-19T14:49:01.852039Z 0 [Warning] –bootstrap is deprecated. Please consider using –initialize instead
2017-04-19T14:49:01.868000Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-04-19T14:49:01.868056Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-04-19T14:49:01.888730Z 0 [ERROR] Can’t read from messagefile ‘/usr/share/mysql/english/errmsg.sys’
提示mysql_install_db 命令已弃用,使用mysqld
[mysql@localhost bin]$ ./mysqld –user=mysql –basedir=/mysql/mysql5.7 –datadir=/mysql/mysql5.7/data
[root@webtest1 mysql]# bin/mysqld –initialize –user=mysql –basedir=/mysql/mysql5.7 –datadir=/mysql/mysql5.7/data
2017-04-19T14:50:18.145225Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-04-19T14:50:18.145526Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-04-19T14:50:18.797964Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
2017-04-19T14:50:18.798019Z 0 [Warning] Insecure configuration for –secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2017-04-19T14:50:18.798053Z 0 [Note] ./mysqld (mysqld 5.7.9) starting as process 3578 …
2017-04-19T14:50:18.798104Z 0 [ERROR] Can’t find error-message file ‘/mysql/mysql5.7share/errmsg.sys’. Check error-message file location and ‘lc-messages-dir’ configuration directive.
2017-04-19T14:50:18.802586Z 0 [Note] InnoDB: PUNCH HOLE support not available
2017-04-19T14:50:18.802645Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-04-19T14:50:18.802656Z 0 [Note] InnoDB: Uses event mutexes
2017-04-19T14:50:18.802665Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
2017-04-19T14:50:18.802674Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-04-19T14:50:18.802682Z 0 [Note] InnoDB: Using Linux native AIO
2017-04-19T14:50:18.803153Z 0 [Note] InnoDB: Number of pools: 1
2017-04-19T14:50:18.803868Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-04-19T14:50:18.843406Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-04-19T14:50:18.860507Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-04-19T14:50:18.864349Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-04-19T14:50:18.878937Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-04-19T14:50:18.901395Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-04-19T14:50:18.901629Z 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
2017-04-19T14:50:18.943961Z 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12 MB.
2017-04-19T14:50:18.945376Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-04-19T14:50:18.945403Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-04-19T14:50:18.952368Z 0 [Note] InnoDB: 5.7.9 started; log sequence number 2471242
2017-04-19T14:50:18.974882Z 0 [Note] InnoDB: Loading buffer pool(s) from /mysql/mysql5.7/data/ib_buffer_pool
2017-04-19T14:50:18.976665Z 0 [Note] InnoDB: Buffer pool(s) load completed at 151119 6:50:18
2017-04-19T14:50:18.978694Z 0 [Note] InnoDB: not started
2017-04-19T14:50:18.978878Z 0 [Note] Plugin ‘FEDERATED’ is disabled.
2017-04-19T14:50:18.983412Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2017-04-19T14:50:18.984289Z 0 [Warning] CA certificate ca.pem is self signed.
2017-04-19T14:50:19.003696Z 0 [Note] Server hostname (bind-address): ‘*’; port: 3306
2017-04-19T14:50:19.021246Z 0 [Note] IPv6 is available.
2017-04-19T14:50:19.021291Z 0 [Note] – ‘::’ resolves to ‘::’;
2017-04-19T14:50:19.021299Z 0 [Note] Server socket created on IP: ‘::’.
2017-04-19T14:50:19.037949Z 0 [ERROR] Could not create unix socket lock file /var/lib/mysql/mysql.sock.lock.
2017-04-19T14:50:19.037976Z 0 [ERROR] Unable to setup unix socket lock file.
2017-04-19T14:50:19.037982Z 0 [ERROR] Aborting
2017-04-19T14:50:19.038004Z 0 [Note] Binlog end
2017-04-19T14:50:19.038084Z 0 [Note] Shutting down plugin ‘ngram’
2017-04-19T14:50:19.038094Z 0 [Note] Shutting down plugi