MySQL: 指定安装版本5.5
参考连接:Is it possible to install MySQL 5.5 or 5.6 on Ubuntu 16.04?
StackOverFlow
Step by step guide* to install mysql 5.5.x on Ubuntu 16.04 Xenial-Xerus. Please see this documentation
OR
See steps below:
Installing MySQL 5.5.51 on Ubuntu 16.06
-
Uninstall any existing version of MySQL
1
sudo rm /var/lib/mysql/ -R
-
Delete the MySQL profile
1
sudo rm /etc/mysql/ -R
-
Automatically uninstall mysql
1 2
sudo apt-get autoremove mysql* --purge sudo apt-get remove apparmor
-
Download version 5.5.51 from MySQL site
1
wget https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz
-
Add
mysql
user group1
sudo groupadd mysql
-
Add
mysql
(not the current user) tomysql
user group1
sudo useradd -g mysql mysql
-
Extract
mysql-5.5.51-linux2.6-x86_64.tar.gz
to/usr/local
1 2
cd /usr/local sudo tar -xvf mysql-5.5.49-linux2.6-x86_64.tar.gz
-
Create
mysql
folder in/usr/local
1
sudo mv mysql-5.5.49-linux2.6-x86_64 mysql
-
Set
mysql
directory owner and user group1 2
cd mysql sudo chown -R mysql:mysql *
-
Install the required lib package
1
sudo apt-get install libaio1
-
Execute mysql installation script
1
sudo scripts/mysql_install_db --user=mysql
-
Set mysql directory owner from outside the mysql directory
1
sudo chown -R root .
-
Set data directory owner from inside mysql directory
1
sudo chown -R mysql data
-
Copy the mysql configuration file
1
sudo cp support-files/my-medium.cnf /etc/my.cnf
-
Start mysql
1 2
sudo bin/mysqld_safe --user=mysql & sudo cp support-files/mysql.server /etc/init.d/mysql.server
-
Initialize root user password
1
sudo bin/mysqladmin -u root password '111111'
-
Start mysql server
1
sudo /etc/init.d/mysql.server start
-
Stop mysql server
1
sudo /etc/init.d/mysql.server stop
-
Check status of mysql
1
sudo /etc/init.d/mysql.server status
-
Enable myql on startup
1
sudo update-rc.d -f mysql.server defaults
-
Disable mysql on startup (Optional)
1
sudo update-rc.d -f mysql.server remove
-
Add mysql path to the system
1
sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
-
Now directly use the command below to start mysql
1
mysql -u root -p
PS: One needs to reboot in order for the changes to take place.
Based on a Chinese blog
ubuntu 16.04 mysql 相关
ubuntu 16.04 mysql 相关
如何彻底卸载某一版本的数据库
彻底删除ubuntu下的mysql: 1、删除mysql的数据文件
|
|
2、删除mqsql的配置文件
|
|
3自动卸载mysql的程序
|
|
ubuntu 16.04上如何安装mysql 5.5.49版本
此网址打开以后选择linux-generic平台,最后一个文件
然后按以下步骤安装 参考官方原文
1、添加mysql用户组
|
|
2、添加 mysql(不是当前用户)添加到 mysql 用户组
|
|
3、解压 mysql-5.5.49-linux2.6-x86_64.tar.gz(我将此文件放在了git[当前用户]的文档
文件夹中) 到 /usr/local 进入 /usr/local
|
|
4、设置 mysql 目录的拥有者和所属的用户组
|
|
5、安装所需要lib包
|
|
6、执行mysql 安装脚本
|
|
7、再次设置 mysql 目录的拥有者
|
|
8、设置 data 目录的拥有者
|
|
9、复制 mysql 配置文件
|
|
10、启动 mysql
|
|
11、初始化 root 用户密码
|
|
12、启动
|
|
13、停止
|
|
14、查看状态
|
|
15、开机启动
|
|
16、停止开机启动
|
|
17、把 /usr/local/mysql/bin/mysql 命令加到用户命令中,这样就不用每次都加 mysql命令的路径
|
|
Written on April 30, 2016
Ubuntu 完全卸载、源代码安装 MySQL8.0
首先用 dpkg –list|grep mysql 查看自己的 mysql 有哪些依赖
|
|
先卸载
|
|
然后:
|
|
再查看,还剩什么就卸载什么
|
|
最后清楚残留数据:
|
|
就可以了
CentOS7:安装 MySQL5.5
|
|