Linux(Ubuntu)下Mysql5.6.28安装配置⽅法图⽂教程mysql5.6.28安装配置⽅法
1.系统基本信息查看,尝试yum安装
$ sudo -s
# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 79G 1.6G 74G 3% /
udev 3.9G 8.0K 3.9G 1% /dev
tmpfs 799M 252K 799M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 3.9G 0 3.9G 0% /run/shm
# uname -a
Linux nj01 3.16.0-34-generic #47~14.04.1-Ubuntu SMP Fri Apr 10 17:49:16 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
# rpm -qa|grep yum
The program 'rpm' is currently not installed. You can install it by typing:
apt-get install rpm
# apt-get install rpm
……
# rpm -qa|grep yum
# yum install
The program 'yum' is currently not installed. You can install it by typing:
apt-get install yum
# apt-get install yum
……
# yum install mysql
Setting up Install Process
No package mysql available.
Nothing to do
2.更换安装⽅式
安装过程中输⼊root的密码即可;
3.安装成功,基本配置
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' identified by '******';
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>
mysql>
mysql>
mysql>
mysql> create database testdb;
Query OK, 1 row affected (0.01 sec)
mysql>
mysql>
mysql>
mysql>
mysql> show databases;
ubuntu安装教程+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| testdb |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)
mysql> insert into mysql.user(Host,User,Password) values("%","test",password("******"));
Query OK, 1 row affected, 3 warnings (0.00 sec)
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON testdb.* TO 'test'@'% identified by '******';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
4.问题解决
(1)访问报错,⽹络连接报错:10038 ,telnet 不通 S1.关闭防⽕墙 # ufw allow 3306 ,还是不⾏
S2.⽤户⽹络权限已经给了(rant all privileges on . to ‘root'@'%' identified by ‘youpassword' with grant option;)
S3.查看⽹路信息 # netstat -ano
tcp 0 0 127.0.0.1:3306
应该是绑定IP问题,修改/etc/f
到bind-address = 127.0.0.1这⼀⾏
改为bind-address = 0.0.0.0,问题解决。
(2)表区分⼤⼩写:⽤root帐号登录后,在/etc/myf 中的[mysqld]后添加添加lower_case_table_names=1,重启MYSQL 服务,这时已设置成功:不区分表名的⼤⼩写;
lower_case_table_names参数详解:
lower_case_table_names = 0
其中 0:区分⼤⼩写,1:不区分⼤⼩写
5.基本服务命令
# 启动MySQL$ sudo service mysql start
# 关闭MySQL$ sudo service mysql stop
# 重启MySQL$ sudo service mysql restart
# 其他命令:$ sudo /etc/init.d/mysql start
$ sudo /etc/init.d/mysql stop
$ sudo /etc/init.d/mysql restart
6.卸载Mysql:
sudo apt-get autoremove mysql* --purge
sudo apt-get remove apparmor
sudo apt-get install mysql-server mysql-common
卸载后删除mysql相关⽂件(/var/lib/mysql , /etc/mysql等等,可以⽤ find -name mysql 查询下相关路径)
以上就是本⽂的全部内容,希望对⼤家的学习有所帮助,也希望⼤家多多⽀持。
发布评论