linux分区安装mysql_Linux安装Mysql

1.检查是否已安装mysql

yum list installed mysql*

2.卸载现有Mysql

yum remove Mysql**(当前版本,上一步命令查询出来的结果)

3.下载rpm文件

wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

4.接着执行这句,解释一下,这个rpm还不是mysql的安装文件,只是两个yum源文件,执行后,在/etc/yum.repos.d/ 这个目录下多出mysql-community-source.repo和mysql-community.repo

rpm -ivh mysql-community-release-el6-5.noarch.rpm

5.安装mysql 服务器命令(一路yes):

yum install mysql-community-server

6.安装成功后,启动服务

service mysqld start

启动后,最好查看一下启动日志是否有错误信息,日志目录:/var/log/mysqld.log

1)错误1:

2017-11-27 19:51:05 6120 [Note] Plugin 'FEDERATED' is disabled.

2017-11-27 19:51:05 6120 [Note] InnoDB: Using atomics to ref count buffer pool pages

2017-11-27 19:51:05 6120 [Note] InnoDB: The InnoDB memory heap is disabled

2017-11-27 19:51:05 6120 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2017-11-27 19:51:05 6120 [Note] InnoDB: Memory barrier is not used

2017-11-27 19:51:05 6120 [Note] InnoDB: Compressed tables use zlib 1.2.3

2017-11-27 19:51:05 6120 [Note] InnoDB: Using Linux native AIO

2017-11-27 19:51:05 6120 [Note] InnoDB: Using CPU crc32 instructions

2017-11-27 19:51:05 6120 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2017-11-27 19:51:05 6120 [Note] InnoDB: Completed initialization of buffer pool

2017-11-27 19:51:05 6120 [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!

2017-11-27 19:51:05 6120 [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!

2017-11-27 19:51:05 6120 [ERROR] Plugin 'InnoDB' init function returned error.

2017-11-27 19:51:05 6120 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2017-11-27 19:51:05 6120 [ERROR] Unknown/unsupported storage engine: InnoDB

2017-11-27 19:51:05 6120 [ERROR] Aborting

针对以上报错,需要在/var/lib/mysql路径下删除rm ibdata1 ib_logfile0 ib_logfile1三个文件

2)错误2:

2017-11-28 13:24:36 7078 [ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it

根据提示需要执行更新命令:mysql_upgrade -u root -p

8.对局域网开通访问权限 进入mysql执行:

mysql> use mysql;

mysql> select user,host from user;

+------+-----------------------+

| user | host |

+------+-----------------------+

| root | 127.0.0.1 |

| root | 172.16.% |

| | localhost |

| root | localhost |

| | localhost.localdomain |

| root | localhost.localdomain |

+------+-----------------------+

该结果表示root用户只能用户localhost连接访问。需要更新表信息:

mysql> update user set host='%' where user='root';

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值