linux 下 MySQL源碼包的安裝
實驗環境 VMware
實驗目的 初步涉及源碼包的安裝
內核版本
今天嘗試安裝MySQL的源碼包 mysql
下載源碼包 copy 到linux
[root@localhost ~]# cd /tmp
[root@localhost tmp]# ls
gconfd
gconfd
keyring
linuxqq_v
linuxqq_v
mapping
mapping
mysql
orbit
scim
scim
[root@localhost tmp]#
[root@localhost tmp]# tar zxvf mysql
把源碼包mysql
[root@localhost tmp]# cd mysql
進入mysql
[root@localhost mysql
acconfig
acinclude
aclocal
bdb depcomp libmysqld myisammrg sql
BUILD Docs libmysql_r mysql
ChangeLog EXCEPTIONS
client extra ltmain
config
config
config
configure install
[root@localhost mysql
INSTALL
添加mysql用戶組
[root@localhost mysql
You have mail in /var/spool/mail/root
添加mysql用戶 並指定到mysql組中
[root@localhost mysql
[root@localhost mysql
[root@localhost mysql
你也可以直接運行下面這條命令直接執行編譯准備
[root@localhost mysql
編譯前的准備
試計算機性能不同
[root@localhost mysql
編譯過程
[root@localhost mysql
編譯安裝 稍等
[root@localhost mysql
復制mysql配置文件
[root@localhost mysql
進入安裝目錄
[root@localhost mysql]# bin/mysql_install_db
使用mysql用戶 初始化數據庫
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
To start mysqld at boot time you have to copy support
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so
/usr/local/mysql/bin/mysqladmin
/usr/local/mysql/bin/mysqladmin
See the manual for more instructions
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the
cd sql
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!
The latest information about MySQL is available on the web at
[url][/url]
Support MySQL by buying support/licenses at [url][/url]
[root@localhost mysql]#
[root@localhost mysql]# chown
改變當前目錄的所有屬主為root
[root@localhost mysql]# chown
改變var的屬主為mysql
[root@localhost mysql]# chgrp
改變當前目錄的屬組為mysql
[root@localhost mysql]#
[root@localhost mysql]# bin/mysqld_safe
後台啟動mysql服務 &為後台啟動
[
[root@localhost mysql]# Starting mysqld daemon with databases from /usr/local/mysql/var
[root@localhost mysql]#
[root@localhost mysql]# /usr/local/mysql/bin/mysql
登陸到mysql數據庫
Welcome to the MySQL monitor
Your MySQL connection id is
Type
mysql>
mysql> show databases ;
基本的查看數據庫命令
+
| Database |
+
| mysql |
| test |
+
mysql>
mysql> ?
查詢命令
For the complete MySQL Manual online visit:
[url][/url]
For info on technical support from MySQL developers visit:
[url][/url]
For info on MySQL books
[url][/url]
List of all MySQL commands:
(Commands must appear first on line and end with
help (\h) Display this help
? (\?) Synonym for `help
clear (\c) Clear command
connect (\r) Reconnect to the server
edit (\e) Edit command with $EDITOR
ego (\G) Send command to mysql server
exit (\q) Exit mysql
go (\g) Send command to mysql server
nopager (\n) Disable pager
notee (\t) Don
pager (\P) Set PAGER [to_pager]
print (\p) Print current command
prompt (\R) Change your mysql prompt
quit (\q) Quit mysql
rehash (\#) Rebuild completion hash
source (\
status (\s) Get status information from the server
system (\!) Execute a system shell command
tee (\T) Set outfile [to_outfile]
use (\u) Use another database
Connection id:
mysql> quit
Bye
[root@localhost mysql]#
退出數據庫
From:http://tw.wingwit.com/Article/program/MySQL/201311/29357.html