阿里云里的mysql安装

今天又整里下mysql安装,卸载先:


[root@ora11g ~]# rpm -qa |grep -i mysql
MySQL-server-5.6.12-1.linux_glibc2.5
[root@ora11g ~]# rpm -e MySQL-server-5.6.12-1.linux_glibc2.5
由于rpm –e并不会卸载mysql的数据库,需要手动rm删除掉。
[root@ora11g ~]# ls -l /var/lib/mysql/

[root@ora11g ~]# rm -rf /var/lib/mysql/

安装mysql服务端rpm包
[root@ora11g ~]# rpm -ivh MySQL-server-5.6.12-1.linux_glibc2.5.x86_64.rpm


启动之后,老是爆:

The server quit without updating PID file (/var/lib/mysql/AY1403301919063486b3Z.pid)

。照网上的教程解决不了。

后来发现时swapon没开启(至于怎么创建swap分区,实在不记得了)

于是

>swapon /tmp/swapfile

>service mysql start

搞定!!

后来遇到 密码问题


 [root@ora11g mysql]# mysql -u root
mysql: Unknown OS character set 'GB18030'.
mysql: Switching to the default character set 'latin1'.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

记得安装mysql 5.5的版本mysql默认的密码都是空的,也就是root没有设置密码,看来在mysql 5.6之后有了改变 。

Mysql server的rpm安装中有这么一段话,看来密码随机生成到/root/.mysql_secret文件中了
2013-06-26 10:19:39 11874 [Note] InnoDB: 5.6.12 started; log sequence number 0
A random root password has been set. You will find it in '/root/.mysql_secret'.

[root@ora11g ~]# less /root/.mysql_secret
# The random password set for the root user at Wed Jun 26 10:19:41 2013 (local time): qG0hZOc

再次登录mysql server
[root@ora11g mysql]# mysql -u root -p
Enter password:

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

而比较奇怪的是需要先设置PASSWORD才能执行命令
mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

mysql> set PASSWORD=PASSWORD('root');

或者
update user set password=password('root') where user='root';


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值