1. Addaloginuserandgroupfor 'mysqldtorunas: installation | tar-xvf mysql installation
1. Add a login user and group for 'mysqld 'to run as: Add a login user and group for 'mysqld'
Shell> groupadd mysql
Shell> useradd-g mysql
2. extract
Shell> gunzip | mysql-5.0.15.tar.gz | tar-xvf-
Shell> cd mysql-5.0.15
3. Configure the release and compile everything: configure and compile to Configure to allocate executable files
Shell> chmod + x configure
Change character set to GBK [default character set to ISO-8859-1 (Latin1)]
Shell>./configure -- prefix =/usr/local/mysql -- with-charset = gbk
Shell> make
(Character sets include big5, cp1251, cp1257, czech, danish, dec8, dos, euc_kr, gb2312 gbk, german1, hebrew, hp8, hungarian, koi8_ru, expires, latin1, latin2, sjis, swe7, tis620, ujis, usa7, win1251, or win1251ukr)
4. install everything
Shell> make install
5. if you want to install the option file, use the existing 'support-files' folder as the template, for example:
Shells> cp support-files/my-medium.cnf/etc/my. cnf
6. if you want to enable mysqld automatically at startup. Cp-r support-files/mysql. server/etc/init. d /.
Shell> cp-r support-files/mysql. server/etc/init. d/mysql
Shell> cd/etc/rc. d/init. d
Shell> chmod + x mysql
Shell>/sbin/chkconfig -- del mysql
Shell>/sbin/chkconfig -- add mysql
7. go to the installation directory
Shell> cd/usr/local/mysql
8. if you have not installed MySQL before, you must create a table permitted by MySQL.
Shell> bin/mysql_install_db -- user = mysql
9. Grant all permissions of the program to 'root' and give ownership of the data directory to the user who can run 'mysqld. Assume that the installation directory of MySQL is '/usr/local/mysql'. the command is as follows:
Give the file ownership to 'root'
Shell> chown-R root.
Grant the data directory support permission to the 'mysql' user
Shell> chown-R mysql var
Grant group permissions to the 'mysql' Group
Shell> chgrp-R mysql.
10. after everything is ready, you can test and run your MySQL using the following command:
Shell>/usr/local/mysql/bin/mysqld_safe -- user = mysql &
Shell> service mysql start
11. after everything is normal, the first thing to do is to change the administrator password. You can run mysqladmin (note that this command is not necessarily in your path, so it is best to directly execute it in the directory of this command ):
Shell> cd bin
Shell>./mysqladmin-u root password *********
12. run other users to access the local machine:
Shell>./mysql-u root-p mysql
-------------------- Enter the administrator password you just modified here
Mysql> update user set host = ''Where host = 'localhost' and user = 'root ';
Mysql> exit
Bye
13. modify the mysql database port number
Shell> vi/etc/my. cnf
-------------------- Modify the port = ***** in it to specify the port number you need.
14. restart the application
Shell> service mysql restart