Install mysql & nbsp; install the MySQL source package in linux & nbsp; VMware6.5.2 + redhatEnterprise5AS & nbsp; & nbsp; the purpose of this experiment is to install the source code package for the purpose of simple implementation of its functions. we will not discuss the principle in depth & nbsp; kernel version: & nbsp; install mysql
Install the MySQL source package in linux
Experimental environment VMware 6.5.2 + redhatEnterprise 5
The purpose of this experiment is to install the source code package for the purpose of simple implementation of its functions.
Kernel version:
Try installing MySQL source package mysql-4.0.27.tar.gz today
Download source code package copy to linux
[Root @ localhost ~] # Cd/tmp
[Root @ localhost tmp] # ls
Gconfd-laowu scim-helper-manager-socket-root
Gconfd-root scim-panel-socket: 0-laowu
Keyring-8zb2FJ scim-panel-socket: 0-root
Linuxqq_v1.0.2-beta1_i386 scim-socket-frontend-root
Linuxqq_v1.0.2-beta1_i386.tar.gz sealert. log.
Mapping-laowu ssh-lgCAZY2854
Mapping-root virtual-root.Kez8K1
Mysql-4.0.27.tar.gz VMwareDnD.
Orbit-root vmware-root
Scim-bridge-0.3.0.lockfile-0 @ localhost: 0.0 VMwareTools-7.8.4-126130.tar.gz
Scim-bridge-0.3.0.socket-0 @ localhost: 0.0 vmware-tools-distrib
[Root @ localhost tmp] #
[Root @ localhost tmp] # tar zxvf mysql-4.0.27.tar.gz
Decompress the source code package mysql-4.0.27.tar.gz to the current directory.
[Root @ localhost tmp] # mysql-4.0.27 cd
Go to mysql-4.0.27 Directory
[Root @ localhost: mysql-4.0.27] # ls
Acconfig. h configure. in INSTALL-SOURCE missing regex
Acinclude. m4 COPYING isam mkinstalldirs scripts
Aclocal. m4 dbug libmysql myisam SQL
Bdb depcomp libmysqld myisammrg SQL-example
BUILD Docs libmysql_r mysql-test strings
ChangeLog EXCEPTIONS-CLIENT ltconfig mysys support-files
Client extra ltmain. sh netware tests
Config. guess heap Makefile. am os2 tools
Config. h. in include Makefile. in pstack vio
Config. sub innobase man readline
Configure install-sh merge README
[Root @ localhost mysql-4.0.27] #
INSTALL-SOURCE the installation command you need
Add a mysql User Group
[Root @ localhost mysql-4.0.27] # groupadd mysql
You have mail in/var/spool/mail/root
Add a mysql User and specify it to the mysql Group
[Root @ localhost mysql-4.0.27] # useradd-g mysql
[Root @ localhost mysql-4.0.27] #
[Root @ localhost mysql-4.0.27] # echo "/* Linuxthreads */">/usr/include/pthread. h
You can also directly run the following command to directly execute compilation preparation. if there is an error, try the shadow command above.
[Root @ localhost mysql-4.0.27] #./configure -- prefix =/usr/local/mysql
Before compilation, specify the installation directory to/usr/local/mysql.
The performance of the test computer varies slightly.
[Root @ localhost mysql-4.0.27] # make
Compilation process
[Root @ localhost mysql-4.0.27] # make install
Compile and install
[Root @ localhost mysql-4.0.27] # cp support-files/my-medium.cnf/etc/my. cnf
Copy the mysql configuration file
[Root @ localhost mysql-4.0.27] # cd/usr/local/mysql
Go to the installation directory
[Root @ localhost mysql] # bin/mysql_install_db -- user = mysql
Use a mysql User to initialize a database
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
090501 15:30:45/usr/local/mysql/libexec/mysqld: Shutdown Complete
To start mysqld at boot time you have to copy support-files/mysql. server
To the right place for your system
Please remember to set a password for the MySQL root USER!
To do so, start the server, then issue the following commands:
/Usr/local/mysql/bin/mysqladmin-u root password 'new-password'
/Usr/local/mysql/bin/mysqladmin-u root-h localhost. localdomain password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon:
Cd/usr/local/mysql;/usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'SQL-Shanghai' directory:
Cd SQL-scripts; perl run-all-tests
Please report any problems with the/usr/local/mysql/bin/mysqlbug script!
The latest information about MySQL is available on the web
[Url] http://www.mysql.com [/url]
Support MySQL by buying support/licenses at [url] http://shop.mysql.com [/url]
[Root @ localhost mysql] #
[Root @ localhost mysql] # chown-R root.
Change the owner of the current directory to root.
-R is recursive (that is, the owner of all the sub-files under it is also changed to root)
[Root @ localhost mysql] # chown-R mysql var
Change the owner of var to mysql.
[Root @ localhost mysql] # chgrp-R mysql.
Change the Group of the current directory to mysql
[Root @ localhost mysql] #
[Root @ localhost mysql] # bin/mysqld_safe -- user = mysql &
Start mysql service in the background & start for the background
[1] 17776
[Root @ localhost mysql] # Starting mysqld daemon with databases from/usr/local/mysql/var
[Root @ localhost mysql] #
[Root @ localhost mysql] #/usr/local/mysql/bin/mysql
Log on to the mysql database
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 1 to server version: 4.0.27-log
Type 'help; 'or' \ H' for help. Type '\ C' to clear the buffer.
Mysql>
Mysql> show databases;
Basic database commands
+ ---------- +
| Database |
+ ---------- +
| Mysql |
| Test |
+ ---------- +
2 rows in set (0.00 sec)
Mysql>
Mysql>?
Query command
For the complete MySQL Manual online visit:
[Url] http://www.mysql.com/documentation#/url]
For info on technical support from MySQL developers visit:
[Url] http://www.mysql.com/support#/url]
For info on MySQL books, utilities, consultants, etc. visit:
[Url] http://www.mysql.com/portal#/url]
List of all MySQL commands:
(Commands must appear first on line and end ';')
Help (\ h) Display this help.
? (\?) Synonym for 'help '.
Clear (\ c) Clear command.
Connect (\ r) Reconnect to the server. Optional arguments are db and host.
Edit (\ e) Edit command with $ EDITOR.
Ego (\ G) Send command to mysql server, display result vertically.
Exit (\ q) Exit mysql. Same as quit.
Go (\ g) Send command to mysql server.
Nopager (\ n) Disable pager, print to stdout.
Notee (\ t) Don't write into outfile.
Pager (\ P) Set PAGER [to_pager]. Print the query results via PAGER.
Print (\ p) Print current command.
Prompt (\ R) Change your mysql prompt.
Quit (\ q) Quit mysql.
Rehash (#) Rebuild completion hash.
Source (\.) Execute a SQL script file. Takes a file name as an argument.
Status (\ s) Get status information from the server.
System (\!) Execute a system shell command.
Tee (\ T) Set outfile [to_outfile]. Append everything into given outfile.
Use (\ u) Use another database. Takes database name as argument.
Connection id: 2 (Can be used with mysqladmin kill)
Mysql> quit
Bye
[Root @ localhost mysql] #
Exit database