How to install MySQL on Ubuntu/Debian
2012-05-17 14:54
417 查看
12 December 2007
Tagged
ubuntu, mysql, debian
It may seem easy for some, but for others, installing MySQL on Ubuntu
or Debian Linux is not an easy task. This article explains to you how
to install the MySQL Server and Client packages on a Ubuntu/Debian
system.
First of all, make sure your package management tools are up-to-date.
Also make sure you install all the latest software available.
After a few moments (or minutes, depending on the state of your system), you're ready to install MySQL. By default, recent Ubuntu/Debian systems install a MySQL Server from the 5-branch. This is a good thing, so don't worry.
First, install the MySQL server and client packages:
When done, you have a MySQL database read to rock 'n roll. However, there's more to do.
You need to set a root password, for starters. MySQL has it's own user accounts, which are not related to the user accounts on your Linux machine. By default, the root account of the MySQL Server is empty. You need to set it. Please replace 'mypassword' with your actual password and myhostname with your actual hostname.
Now, you probably don't want just the MySQL Server. Most likely you have Apache+PHP already installed, and want MySQL to go with that. Here are some libraries you need to install to make MySQL available to PHP:
Or for Ruby:
You can now access your MySQL server like this:
Have fun using MySQL Server.
Tagged
ubuntu, mysql, debian
It may seem easy for some, but for others, installing MySQL on Ubuntu
or Debian Linux is not an easy task. This article explains to you how
to install the MySQL Server and Client packages on a Ubuntu/Debian
system.
First of all, make sure your package management tools are up-to-date.
Also make sure you install all the latest software available.
sudo apt-get update sudo apt-get dist-upgrade
After a few moments (or minutes, depending on the state of your system), you're ready to install MySQL. By default, recent Ubuntu/Debian systems install a MySQL Server from the 5-branch. This is a good thing, so don't worry.
First, install the MySQL server and client packages:
sudo apt-get install mysql-server mysql-client
When done, you have a MySQL database read to rock 'n roll. However, there's more to do.
You need to set a root password, for starters. MySQL has it's own user accounts, which are not related to the user accounts on your Linux machine. By default, the root account of the MySQL Server is empty. You need to set it. Please replace 'mypassword' with your actual password and myhostname with your actual hostname.
sudo mysqladmin -u root -h localhost password 'mypassword' sudo mysqladmin -u root -h myhostname password 'mypassword'
Now, you probably don't want just the MySQL Server. Most likely you have Apache+PHP already installed, and want MySQL to go with that. Here are some libraries you need to install to make MySQL available to PHP:
sudo apt-get install php5-mysql
Or for Ruby:
sudo apt-get install libmysql-ruby
You can now access your MySQL server like this:
mysql -u root -p
Have fun using MySQL Server.
相关文章推荐
- How To Install Kernel 3.10 On Ubuntu, Linux Mint, Debian and Derivates
- How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04
- How To Install and Secure phpMyAdmin on Ubuntu 12.04(MySQL图形管理)
- 在ubuntu上安装mysql : How to install MySQL on ubuntu(转)
- How To Install MySQL on Ubuntu 16.04
- How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Debian
- How To Install Linux, Nginx, MySQL, PHP (LEMP) Stack on Debian 7
- How to Install and Configure Bind 9 (DNS Server) on Ubuntu / Debian System
- How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 14.04
- How to install mysql 5.5 or 5.6 on ubuntu 16.04 xenial
- How To Install Linux, Nginx, MySQL, PHP (LEMP) Stack on Debian 7
- How to install and configure Apache, PHP, MySql and phpMyadmin on ubuntu
- How To Install Linux, nginx, MySQL, PHP (LEMP) stack on Ubuntu 12.04
- How to install Firefox 17 on Linux Mint, Ubuntu, Debian, CentOS, Fedora ... or any other Linux dist
- How To Install LAMP (Linux, Apache, MySQL, PHP) On Ubuntu 11.04/11.10/12.04
- How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Debian
- How-To: Install Google’s Android Eclipse plugin (and/or adb) on 64-bit Debian/Ubuntu
- How To Install MySQL on Ubuntu 16.04
- How to install and configure Apache, PHP, MySql and phpMyadmin on ubuntu
- How to Install Linux, Apache, MySQL, PHP (LAMP) stack on CentOS 6 【Reliable】