How to install mysql 5.5 or 5.6 on ubuntu 16.04 xenial
来源:互联网 发布:优化软件点击 编辑:程序博客网 时间:2024/06/07 04:49
How to install mysql 5.5 or 5.6 on ubuntu 16.04 xenial
Installing MySQL 5.5/6 on Ubuntu 16.06
You might be hosting your site on something like Acquia and they have recently upgraded to Ubuntu 16 Xenial.
However, you (as an awesome developer) still want to duplicate the environment as much as possible so you want to configure a local or staging server using Ubuntu, etc.
Here’s how to install MySQL 5.5/6 on Xenial.
First, a couple items:
- apt-get install mysql
This and other methods of installation will not work. You will need to do the install manually.
UPDATED 7-21-17 – Scroll to the bottom
Find the correct install for MySQL 5.5/6
Go to www.mysql.com > downloads > you will see links for older versions.
When you get to the dropdowns for OS, you will see Ubuntu. Note that these only go up to 14. Instead, select Linux/Generic. Scroll to the bottom to get the TAR Archive – select 32 or 64 bit.
Click download
On the following page look for “No thanks, just start my download.” Right click and copy the URL. Here is the URL for 5.5 as it was when I wrote this:
https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz
Connect to your server.
- Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R
- Delete the MySQL profile
sudo rm /etc/mysql/ -R
- Automatically uninstall mysql
sudo apt-get autoremove mysql* --purgesudo apt-get remove apparmor
- Download version 5.5.51 from MySQL site
wget https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz
https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.38-linux-glibc2.12-x86_64.tar.gz
- Add mysql user group
sudo groupadd mysql
- Add mysql (not the current user) to mysql user group
sudo useradd -g mysql mysql
- Extract to /usr/local
sudo tar -xvf mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz /usr/local/
- Create mysql folder in /usr/local by moving the untarred folder
cd /usr/localsudo mv mysql-5.5.49-linux2.6-x86_64 mysql
- Set mysql directory owner and user group
cd mysqlsudo chown -R mysql:mysql *
- Install the required lib package (works with 5.6 as well)
sudo apt-get install libaio1
- Execute mysql installation script
sudo scripts/mysql_install_db --user=mysql
- Set mysql directory owner from outside the mysql directory
sudo chown -R root .
- Set data directory owner from inside mysql directory
sudo chown -R mysql data
- Copy the mysql configuration file
sudo cp support-files/my-medium.cnf /etc/my.cnf (mysql 5.5)sudo cp support-files/my-default.cnf /etc/my.cnf (mysl 5.6)
- Start mysql
sudo bin/mysqld_safe --user=mysql &sudo cp support-files/mysql.server /etc/init.d/mysql.server
- Initialize root user password
sudo bin/mysqladmin -u root password '[your new password]'
- Add mysql path to the system
sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
- Reboot!
- Start mysql server
sudo /etc/init.d/mysql.server start
- Stop mysql server
sudo /etc/init.d/mysql.server stop
- Check status of mysql
sudo /etc/init.d/mysql.server status
- Enable myql on startup
sudo update-rc.d -f mysql.server defaults
Disable mysql on startup (Optional)
sudo update-rc.d -f mysql.server remove
- REBOOT!
- Now directly use the command below to start mysql if it hasn’t
sudo service start mysql -u root -p
- How to install mysql 5.5 or 5.6 on ubuntu 16.04 xenial
- How To Install MySQL on Ubuntu 16.04
- How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04
- How to Configure and Install ownCloud on Ubuntu 16.04
- How To Install Apache Tomcat 8 on Ubuntu 16.04
- How To Install Java with Apt-Get on Ubuntu 16.04
- How To Install WordPress with LAMP on Ubuntu 16.04
- [MongoDB--Unbuntu installation]---How to Install MongoDB on Ubuntu 16.04
- How To Install WordPress with LAMP on Ubuntu 16.04
- How to Install Review Board on Ubuntu 16.04
- How To Install Java with Apt-Get on Ubuntu 16.04
- How to Install Fonts on Ubuntu
- How to install gCvs on ubuntu 10.04
- How to install p2psim on ubuntu.10.10
- How to install chrome on Ubuntu 10.10
- how to install software on ubuntu?
- How to install GSL on linux(ubuntu)
- How to install VNC on Ubuntu
- poj3734(矩阵快速幂)
- Java实现快速排序
- 查找
- Overlapping Rectangles
- 向上取整和向下取整
- How to install mysql 5.5 or 5.6 on ubuntu 16.04 xenial
- 学习笔记之面向对象编程23(多线程机制2)
- 接口自动化测试-xlrd模块处理表格文件
- Map Reduce操作步骤
- 通过分频器和乘法器来实现对频率的减倍和倍增效果
- STM32低功耗实验总结
- 2. Add Two Numbers
- 数据结构之单链表基本操作
- 面向对象特征三-多态性