CentOS下安装Mysql记录


安装环境

  • 系统: CentOS6 64位

安装步骤

开始通过命令sudo yum install mysql-server安装后,使用mysql --version查看版本,为 5.1.73。

因为要安装5.6版,故卸载5.1版,下载本地包重新安装,如下所示

# rpm -ivh MySQL-server-5.6.15-1.el6.i686.rpm
# rpm -ivh MySQL-client-5.6.15-1.el6.i686.rpm
# rpm -ivh MySQL-shared-5.6.15-1.el6.i686.rpm

安装完成后,使用命令/etc/init.d/mysql start启动时报错:Starting MySQL.The server quit without updating PID file (/[FAILED]mysql/namenode.pid)

查看/var/lib/mysql/namenode.err,错误详情如下

2016-06-06 14:44:37 29727 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 640 pages (rounded down to MB) than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
2016-06-06 14:44:37 29727 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!

参照MySQL 5.6 Failure中的SUGGESTION #1 : UNINSTALL AND REINSTALL MySQL 5.6解决,即去除旧数据后重新安装即可。

安装完成时,有如下提示

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

意为

  • 安装完成后,已为root用户生成随机密码,在 ‘/root/.mysql_secret’文件中。
  • 第一次连接时必须修改密码,请执行/usr/bin/mysql_secure_installation输入root的初始密码,并依次修改其它选项。

参考

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值