Mysql installation on linux 3 (Binary installation), mysqllinux
Install the Binary source package:
1. Download the binary Mysql installation package from the http://www.mysql.com // This MYSQL is a binary version, do not compile
2. Change permissions
Chmod 755 mysql-5.0.41-linux-i686-glibc23.tar.gz
3. Copy the decompressed directory to/usr/local/and rename it mysql.
Tar xfz mysql-5.0.41-linux-i686-glibc23.tar.gz
4. create user groups and users
Groupadd mysql CREATE a mysql Group
Useradd mysql-g mysql
Create a mysql user and add it to the mysql Group
5. cp/usr/local/mysql/support-files/my-medium.cnf/etc/my. cnf
There are four template files in the support-files directory. We select one of the Mysql configuration files to overwrite/etc/my. cnf (default system configuration, with performance parameters and some path parameters of Mysql)
6. cd/usr/local/mysql
./Scripts/mysql_install_db -- user = mysql
Go to the mysql directory
First try the table and require mysql users to access it. After the table is initialized, set the access permissions for mysql and root users.
7. chown-R root. // set root to access/usr/local/mysql
8. chown-R mysql data
Set the mysql user to access/usr/local/mysql/data, which stores mysql database files. this directory is in/etc/my. cnf is configured and generated in mysql_install_db.
9. chown-R mysql data /.
Set mysql users to access all files in/usr/local/mysql/data/mysql
10. chgrp-R mysql.
Set the mysql group to access/usr/local/mysql
11. #/usr/local/mysql/bin/mysqld_safe -- user = mysql &
Run mysql
[Stop Service #/usr/local/mysql/bin/mysqladmin-uroot-p123/shutdown]
If there is no problem, a prompt like this should appear:
[1] 42264
# Starting mysqld daemon with databases from/usr/local/mysql/var
If a statement such as mysql ended is displayed, it indicates that Mysql is not started normally. You can find the problem in log. The Log file is usually configured in/etc/my. cnf. Most problems are caused by incorrect permission settings.
12. Run the following command to modify the MYSQL password:
/Usr/local/mysql/bin/mysqladmin-u root password yourpassword // The default installation password is empty. You must change it immediately for security purposes.
13. set to enable mysql to run automatically at each startup
Cp support-files/mysql. server/etc/rc. d/init. d/mysqld
Chmod 700/etc/init. d/mysqld
Chkconfig -- add mysqld
Chkconfig -- level 345 mysqld on // copy a script in the compilation directory
14. service mysqld start
Netstat-atln
// Start the mysqld service
// Check whether port 3306 is enabled. Make sure that the port is opened in the firewall.
In linux, do I have to compile and install mysql? Can I download the Binary Package directly and put it in?
Operate on the GUI: in the new version, enter mysql to select mysql server, and then confirm. If you are prompted to install the dependent package, agree that you should enter the password and wait for a while, the system automatically installs it for you.
Perform the following operations on the command line: sudo apt-get install mysql-server. After you enter the password, the system automatically installs it for you.
The rest is that you have configured it. You don't need to talk about it. The installation process is much simpler than in windows. In windows, you need to open your eyes and see that the download is not flashget, Thunder, or other inexplicable things, A problem occurs if the problem is not solved.
Obviously, no compilation or installation is required. Compilation and installation are selected unless for a specific purpose. Mysql is a complex package with many parameters that can be set. Therefore, you need to know more during compilation and installation. Otherwise, use the default one. the results obtained in step 3 of/config, make, and make install are consistent with the installation results in the software center or the new and command line.
Binary mysql installation in linux
Try:
Vi/etc/my. cnf
Add the following in the mysqld field:
Datadir =/var/lib/mysql
If you place/var/lib/mysql in the database during compilation
Write this. If it is another location. Just change it to that location.