数据库 
首页 > 数据库 > 浏览文章

Linux(Ubuntu)下Mysql5.6.28安装配置方法图文教程

(编辑:jimmy 日期: 2024/11/26 浏览:3 次 )

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.更换安装方式

# apt-get install mysql-server
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libnet-daemon-perl libplrpc-perl libterm-readkey-perl mysql-client-5.5
  mysql-client-core-5.5 mysql-common mysql-server-5.5 mysql-server-core-5.5
Suggested packages:
  libipc-sharedcache-perl tinyca mailx
The following NEW packages will be installed:
  libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libnet-daemon-perl libplrpc-perl libterm-readkey-perl mysql-client-5.5
  mysql-client-core-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5
0 upgraded, 13 newly installed, 0 to remove and 15 not upgraded.
Need to get 27.6 MB of archives.
After this operation, 98.2 MB of additional disk space will be used.
Do you want to continue [Y/n]"htmlcode">

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;
+--------------------+
| 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/MySQL/my.conf
找到bind-address = 127.0.0.1这一行
改为bind-address = 0.0.0.0,问题解决。
(2)表区分大小写:
用root帐号登录后,在/etc/my.cnf 中的[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 查询下相关路径)

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

上一篇:Linux安装MySQL5.6.24使用文字说明
下一篇:mysql 5.7.17 免安装版配置方法图文教程(windows10)
一句话新闻
一文看懂荣耀MagicBook Pro 16
荣耀猎人回归!七大亮点看懂不只是轻薄本,更是游戏本的MagicBook Pro 16.
人们对于笔记本电脑有一个固有印象:要么轻薄但性能一般,要么性能强劲但笨重臃肿。然而,今年荣耀新推出的MagicBook Pro 16刷新了人们的认知——发布会上,荣耀宣布猎人游戏本正式回归,称其继承了荣耀 HUNTER 基因,并自信地为其打出“轻薄本,更是游戏本”的口号。
众所周知,寻求轻薄本的用户普遍更看重便携性、外观造型、静谧性和打字办公等用机体验,而寻求游戏本的用户则普遍更看重硬件配置、性能释放等硬核指标。把两个看似难以相干的产品融合到一起,我们不禁对它产生了强烈的好奇:作为代表荣耀猎人游戏本的跨界新物种,它究竟做了哪些平衡以兼顾不同人群的各类需求呢?
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 网站地图 SiteMap