linux 下mysql 5.7.9tar 包安装

原创 2015年11月19日 23:33:00


登录到  ,选择对应的版本进行下载。

2、创建mysql 用户

[root@localhost ~]# groupadd mysql
[root@localhost ~]# useradd -g mysql mysql
[root@localhost ~]# passwd mysql

将tar 包拷贝到mysql的home 目录下,进行解压后得到的目录 重命名为 mysql-5.7.9 


进入 /home/mysql/mysql-5.7.9/bin 

[mysql@localhost bin]$ ./mysql_install_db --user=mysql --basedir=/home/mysql/ --datadir=/home/mysql/data
2015-11-19 06:49:00 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2015-11-19 06:49:07 [ERROR]   The bootstrap log isn't empty:
2015-11-19 06:49:07 [ERROR]   2015-11-19T14:49:01.852039Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead
2015-11-19T14:49:01.868000Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2015-11-19T14:49:01.868056Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2015-11-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=/home/mysql/ --datadir=/home/mysql/data
2015-11-19T14:50:18.145225Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2015-11-19T14:50:18.145526Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2015-11-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).
2015-11-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.
2015-11-19T14:50:18.798053Z 0 [Note] ./mysqld (mysqld 5.7.9) starting as process 3578 ...
2015-11-19T14:50:18.798104Z 0 [ERROR] Can't find error-message file '/home/mysql/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2015-11-19T14:50:18.802586Z 0 [Note] InnoDB: PUNCH HOLE support not available
2015-11-19T14:50:18.802645Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-11-19T14:50:18.802656Z 0 [Note] InnoDB: Uses event mutexes
2015-11-19T14:50:18.802665Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
2015-11-19T14:50:18.802674Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-11-19T14:50:18.802682Z 0 [Note] InnoDB: Using Linux native AIO
2015-11-19T14:50:18.803153Z 0 [Note] InnoDB: Number of pools: 1
2015-11-19T14:50:18.803868Z 0 [Note] InnoDB: Using CPU crc32 instructions
2015-11-19T14:50:18.843406Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2015-11-19T14:50:18.860507Z 0 [Note] InnoDB: Completed initialization of buffer pool
2015-11-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().
2015-11-19T14:50:18.878937Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-19T14:50:18.901395Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2015-11-19T14:50:18.901629Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2015-11-19T14:50:18.943961Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2015-11-19T14:50:18.945376Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2015-11-19T14:50:18.945403Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2015-11-19T14:50:18.952368Z 0 [Note] InnoDB: 5.7.9 started; log sequence number 2471242
2015-11-19T14:50:18.974882Z 0 [Note] InnoDB: Loading buffer pool(s) from /home/mysql/data/ib_buffer_pool
2015-11-19T14:50:18.976665Z 0 [Note] InnoDB: Buffer pool(s) load completed at 151119  6:50:18
2015-11-19T14:50:18.978694Z 0 [Note] InnoDB: not started
2015-11-19T14:50:18.978878Z 0 [Note] Plugin 'FEDERATED' is disabled.
2015-11-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.
2015-11-19T14:50:18.984289Z 0 [Warning] CA certificate ca.pem is self signed.
2015-11-19T14:50:19.003696Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2015-11-19T14:50:19.021246Z 0 [Note] IPv6 is available.
2015-11-19T14:50:19.021291Z 0 [Note]   - '::' resolves to '::';
2015-11-19T14:50:19.021299Z 0 [Note] Server socket created on IP: '::'.
2015-11-19T14:50:19.037949Z 0 [ERROR] Could not create unix socket lock file /var/lib/mysql/mysql.sock.lock.
2015-11-19T14:50:19.037976Z 0 [ERROR] Unable to setup unix socket lock file.
2015-11-19T14:50:19.037982Z 0 [ERROR] Aborting

2015-11-19T14:50:19.038004Z 0 [Note] Binlog end
2015-11-19T14:50:19.038084Z 0 [Note] Shutting down plugin 'ngram'
2015-11-19T14:50:19.038094Z 0 [Note] Shutting down plugin 'ARCHIVE'
2015-11-19T14:50:19.038098Z 0 [Note] Shutting down plugin 'partition'
2015-11-19T14:50:19.038102Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2015-11-19T14:50:19.038106Z 0 [Note] Shutting down plugin 'CSV'
2015-11-19T14:50:19.038112Z 0 [Note] Shutting down plugin 'MEMORY'
2015-11-19T14:50:19.038118Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2015-11-19T14:50:19.038124Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2015-11-19T14:50:19.038128Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2015-11-19T14:50:19.038131Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2015-11-19T14:50:19.038135Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2015-11-19T14:50:19.038138Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2015-11-19T14:50:19.038142Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2015-11-19T14:50:19.038145Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2015-11-19T14:50:19.038149Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2015-11-19T14:50:19.038152Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2015-11-19T14:50:19.038155Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2015-11-19T14:50:19.038159Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2015-11-19T14:50:19.038162Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2015-11-19T14:50:19.038165Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2015-11-19T14:50:19.038168Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2015-11-19T14:50:19.038172Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2015-11-19T14:50:19.038175Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2015-11-19T14:50:19.038179Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2015-11-19T14:50:19.038182Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2015-11-19T14:50:19.038186Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2015-11-19T14:50:19.038189Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2015-11-19T14:50:19.038192Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2015-11-19T14:50:19.038196Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2015-11-19T14:50:19.038199Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2015-11-19T14:50:19.038203Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2015-11-19T14:50:19.038206Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2015-11-19T14:50:19.038210Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2015-11-19T14:50:19.038213Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2015-11-19T14:50:19.038217Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2015-11-19T14:50:19.038221Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2015-11-19T14:50:19.038224Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2015-11-19T14:50:19.038228Z 0 [Note] Shutting down plugin 'InnoDB'
2015-11-19T14:50:19.038317Z 0 [Note] InnoDB: FTS optimize thread exiting.
2015-11-19T14:50:19.038421Z 0 [Note] InnoDB: Starting shutdown...
2015-11-19T14:50:19.151526Z 0 [Note] InnoDB: Dumping buffer pool(s) to /home/mysql/data/ib_buffer_pool
2015-11-19T14:50:19.152515Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 151119  6:50:19
2015-11-19T14:50:20.802442Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2471261
2015-11-19T14:50:20.811473Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2015-11-19T14:50:20.811528Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2015-11-19T14:50:20.811690Z 0 [Note] Shutting down plugin 'MyISAM'
2015-11-19T14:50:20.811730Z 0 [Note] Shutting down plugin 'sha256_password'
2015-11-19T14:50:20.811739Z 0 [Note] Shutting down plugin 'mysql_native_password'
2015-11-19T14:50:20.812061Z 0 [Note] Shutting down plugin 'binlog'
2015-11-19T14:50:20.813161Z 0 [Note] 


[root@localhost ~]# cd /home/mysql/mysql-5.7.9/support-files/
[root@localhost support-files]# cp my-default.cnf /etc/my.cnf 
cp: overwrite `/etc/my.cnf'? yes
[root@localhost support-files]# cp mysql.server /etc/init.d/mysql

vim /etc/init.d/mysql   



[mysql@localhost ~]$ vi .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc

# User specific environment and startup programs

export MYSQL_HOME="/home/mysql/mysql-5.7.9"
export PATH="$PATH:$MYSQL_HOME/bin"


chkconfig --add mysql
chkconfig mysql on


[root@localhost support-files]# su - mysql
[mysql@localhost ~]$ service mysql start
/etc/init.d/mysql: line 256: my_print_defaults: command not found
Starting MySQL ERROR! Couldn't find MySQL server (/home/mysql//bin/mysqld_safe)

启动报错了,原来是编辑/etc/init.d/mysql  文件出错了,修改为下面

vim /etc/init.d/mysql   


[mysql@localhost ~]$ service mysql start
Starting MySQL. SUCCESS! 


1:下载[root@localhost soft]# wget
  • zhou920786312
  • zhou920786312
  • 2017年08月31日 19:20
  • 5560


1.从官网下载最新版的mysql-5.7.12-winx64便携版,解压到需要安装的目录下(我的是解压在:D:\sw),目录结构如下: 2.在该目录下创建一个名为data的空文件夹和一个
  • yaowuliu
  • yaowuliu
  • 2016年04月12日 15:43
  • 10135

MySQL5.6 选项和变量整理

MySQL5.6 选项和变量整理  (2013-04-01 18:10:00) 转载▼ 标签:  mysql5.6配置参数整理 分类: MySQL  --allow-su...
  • wulantian
  • wulantian
  • 2013年12月30日 14:10
  • 14111


原文地址: (呵)近一段时间由于工作需要,终于开始玩Linux了,今天搞了一天的MyS...
  • liuwei0604
  • liuwei0604
  • 2013年05月10日 20:03
  • 5112


添加mysql组和mysql用户,用于设置mysql安装目录文件所有者和所属组。 groupadd mysql useradd -r -g mysql mysql *useradd -r参数表...
  • bao19901210
  • bao19901210
  • 2016年07月15日 17:55
  • 30199


收到个请求说是5.7的库没法启动了,看了下error日志,有如下的提示: 2016-10-17T01:55:15.847715Z 0 [ERROR] Another process with pid...
  • aoerqileng
  • aoerqileng
  • 2016年10月17日 10:10
  • 1266

mysql unix_socket文件丢失处理 mysql.sock被删除

为了数据库安全,限制了mysql中root用户只能本地登录,其他用户不得拥有授权权限。结果悲剧了,登录到一台服务器上发现unix_socket文件不见了。root用户无法登陆。 怎办?情急之下请出D...
  • ylqmf
  • ylqmf
  • 2013年01月22日 21:28
  • 12896

[ERROR] Could not create unix socket lock file /var/run/mysql/mysql.sock.lock

在日志文件 /var/log/mysql/error.log 中可以看到具体的ERROR 信息:Could not create unix socket lock file /var/run/mys...
  • 2016年04月03日 20:41
  • 7296

Linux下Mysql 5.6.30 tar包安装实践

环境:centos 6.5 x64 先下载mysql安装包 打开  选择 linux - Generic 再选择 下...
  • wyhappy612
  • wyhappy612
  • 2017年04月09日 16:22
  • 3342

Linux下Mysql 5.6.21 tar包安装实践

  • zhanngle
  • zhanngle
  • 2014年11月12日 14:05
  • 53189
您举报文章:linux 下mysql 5.7.9tar 包安装