The first time I installed MySQL on Linux (Ubuntu10.10), I had to pay some twists and turns, and finally I had to figure out my ideas. Let's first talk about the steps for my final successful installation, that is, download the mysql source code in Ubuntu10.10, compile and install it. The current mysql version is 5.5.20, and my system version is ubuntu10.101. download the source code: on the official website, select MySQLCommunityServer -- download and select sourceco.
The first time I installed MySQL on Linux (Ubuntu 10.10), I had to pay some twists and turns, and finally I had to figure out my ideas. Let's talk about how to install mysql in Ubuntu 10.10.
The current mysql version is 5.5.20 and my system version is ubuntu 10.10.
1. Download the source code:
On the official website,
Select MySQL Community Server -- download
Select sourcecode, the first few are what rpm, the last one is the package I think should be downloaded
Generic Linux (Architecture Independent), Compressed TAR Archive |
|
5.5.20 |
23.2 M |
Download |
(Mysql-5.5.20.tar.gz) |
2. Download and decompress the package.
There is an installation instruction file: INSTALL-SOURCE
Open, which is the core installation step: (addSudoRun !)
# Preconfiguration setup first adds a user group
Shell> groupadd mysql
Shell> useradd-r-g mysql
# Beginning of source-build specific instructions
Shell> tar zxvf mysql-VERSION.tar.gz extract source package
Shell> cd mysql-VERSION switch to the source package directory
Shell> cmake. Execute cmake to generate the mk file (No cmake, sudo apt-get install cmake)
Shell> make Edit
Install shell> make install
# End of source-build specific instructions ----------- OK. The installation is complete.
# Postinstallation setup ---- configure mysql
Shell> cd/usr/local/mysql
Shell> chown-R mysql.
Shell> chgrp-R mysql.
Shell> scripts/mysql_install_db -- user = mysql --- execute the internal mysql installation (See the execution result below the Red Line)
Shell> chown-R root.
Shell> chown-R mysql data
# Next command is optional -- literal meaning: The following command is optional
Shells> cp support-files/my-medium.cnf/etc/my. cnfCopy the mysql configuration file
Shell> bin/mysqld_safe -- user = mysql &Start Database
# Next command is optional -- literal meaning: The following command is optional
Shell> cp support-files/mysql. server/etc/init. d/mysql. serverSet auto-start
Follow this to complete the installation.
3. After the installation and configuration are complete, go and have a look.
In the/usr/local/mysql directory, run
Root @ www.linuxidc.com-laptop:/usr/local/mysql #./bin/mysql-u root-S/tmp/mysql. sock-p
Normal logon, prompt:
- Server version:5.5.20-Log Source distribution
-
- Copyright (c)2000,2011, Oracle and/or its affiliates. All rights reserved.
-
- Oracle is a registered trademark of Oracle Corporation and/or its
- Affiliates. Other names may be trademarks of their respective
- Owners.
-
- Type'Help ;'Or'\ H' ForHelp. Type'\ C'To clear the current input statement.
-
- Mysql>
4. There is a gui tool on the official website. You can download it and try it out:
MySQL Workbench (GUI Tool)