solaris 10 mysql 安裝 配置
MySQL:
mysql-5.5.12-solaris10-sparc-64bit.tar一、為mysqld增加一個登入使用者和組:
# groupadd mysql
# useradd -d /opt/mysql -g mysql -m mysql
二、挑選一個你想解開分發包的目錄,進入該目錄。將分發包放在“/usr/local”下:
# cd /usr/local
三、解包分發版,將建立安裝目錄。然後生成到該目錄的一個符號連結:
# tar xvf mysql-5.5.12-solaris10-sparc-64bit.tar
# ln -s mysql-5.4.2-beta-solaris10-i386 mysql
四、進入安裝目錄:
# cd mysql
你會在mysql目錄下發現幾個檔案和子目錄,對安裝目的最重要的是“bin”和“scripts”子目錄。
·bin
這個目錄包含客戶端程式和伺服器,你應該把這個目錄的完整路徑加到PATH環境變數,以便shell能正確的找到MySQL程式。
·scripts
這個目錄包含mysql_install_db指令碼,用來初始化mysql資料庫的授權表,其中貯存了伺服器訪問允許。
呼叫mysql.server指令碼。
這個指令碼通過有意用於System V的啟動和停止系統上的safe_mysqld.mysql.server來啟動伺服器,該系統包含幾個包含在機器進入或退出一個給定執行級別時被點用的指令碼目錄。它可以用一個start或stop引數點用以表明你是想啟動還是想停止伺服器。
safe_mysqld指令碼安裝在MySQL安裝目錄的bin目錄下,或可在MySQL原始碼分發的scripts目錄下找到。mysql.server指令碼安裝在MySQL安裝目錄下的share/mysqld目錄下或可以在MySQL原始碼分發的support_files目錄下找到。如果你想使用它們,你需要將它們拷貝到適當的目錄下。
對BSD風格的系統(FreeBSD,OpenBSD等),通常在/etc目錄下有幾個檔案在引導時初始化服務,這些檔案通常有以“rc”開頭的名字,且它有可能由一個名為“rc.local”的檔案(或類似的東西),特意用於啟動本地安裝的服務。在這樣的系統上,你可能將類似於下列的行加入rc.local檔案中以啟動伺服器(如果safe_mysqld的目錄在你的系統上不同,修改它即可):
if [ -x /usr/local/bin/safe_mysqld ]; then /usr/local/bin/safe_mysqld &fi
對於對於System V風格的系統,你可以通過將mysql.server放在/etc下適當的啟動目錄下來安裝它。如果你執行Linux並從一個RPM檔案安裝MySQL,這些已經為你做好了,否則將指令碼安裝在主啟動目錄下,並將指向它的連線放在適當的執行級別目錄下。你也可以使指令碼只能由root啟動。
啟動檔案的目錄佈局各系統不同,所以你需要檢查一下看看你的系統如何組織它們。例如在Linux PPC上,目錄是/etc/rc.d和/etc/rc.d/rc3.d,這樣你可以這樣安裝指令碼:
#cp mysql.server /etc/rc.d/init.d #cd /etc/init.d #chmod 500 mysql.server #cd /etc/rc.d/rc3.d #ln -s /etc/init.d/mysql.server S99mysql
在solaris上,主指令碼目錄是/etc/init.d,並且執行級別目錄是/etc/rd2.d,所以命令看上去像這樣:
#cp mysql.server /etc/init.d
#cd /etc/init.d
#chmod 500 mysql.server
#cd /etc/rc2.d
#ln -s /etc/init.d/mysql.server S99mysql
在系統啟動時,S99mysql指令碼將自動用一個start引數呼叫。如果你有chkconfig命令(Linux上有),你可以由它幫助安裝mysql.server指令碼而不是象上面那樣手工執行上述命令。
五、如果還沒有安裝MySQL,必須建立MySQL授權表:
# scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK
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:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h fs-cluster1 password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script!
The latest information about MySQL is available on the web at
Support MySQL by buying support/licenses at http://shop.mysql.com
#
如果你用root執行命令,應當使用--user選項。選項的值應與你在第一步為執行伺服器所建立的登入賬戶相同。如果你用該使用者登入來執行命令,可以省略--user選項。
六、將程式二進位制的所有權改為root,資料目錄的所有權改為執行mysqld 的使用者:
# chown -R root .
# chown -R mysql data
# chgrp -R mysql .
第一個命令將檔案的所有屬性改為root使用者。第二個命令將資料目錄的所有屬性改為mysql使用者。第三個命令將組屬性改為mysql組。
如果你喜歡在引導機器時自動啟動MySQL,可以拷貝support-files/mysql.server檔案到系統有啟動檔案的地方。
在所有東西被解包並且安裝以後,你應該初始化並且測試你的分發版。
七、可以用下列命令啟動MySQL伺服器:
# bin/mysqld_safe --user=mysql &
[1] 13502
# Starting mysqld daemon with databases from /usr/local/mysql-5.0.45-solaris8-sparc-64bit/data
註釋:MySQL授權表中的賬戶開始沒有密碼。啟動伺服器後,應當設定密碼。
八、其它設定
把/usr/local/mysql/bin放入環境變數PATH裡。
/etc/profile
export LOGNAME PATH
PATH=/usr/local/mysql/bin:$PATH ;
export PATH
直接登陸:
# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.45 MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
修改密碼:
# mysqladmin -u root password 'root'
修改密碼後登陸方式:
# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
# mysql -uroot -proot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.45 MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
九、資料庫起停
使用mysqladmin驗證伺服器在執行中。以下命令提供了簡單的測試,可檢查伺服器是否已經啟動並能響應連線:
#mysqladmin -uroot -proot version
mysqladmin Ver 8.42 Distrib 5.5.12, for solaris10 on sparc
Copyright (c) 2000, 2010, 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.
Server version 5.5.12
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 2 min 27 sec
Threads: 1 Questions: 13 Slow queries: 0 Opens: 33 Flush tables: 1 Open tables: 26 Queries per second avg: 0.88
現在使用者沒有許可權,以root登入mysql,執行grant all on *.* to root@`%`
mysql> grant all on *.* to root@`%`;
Query OK, 0 rows affected (0.00 sec)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/14184018/viewspace-695465/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Mysql安裝與配置_win10MySqlWin10
- MySQL安裝配置MySql
- 【MySQL】安裝與配置MySql
- mysql安裝及配置MySql
- MySQL安裝與配置MySql
- Suse Linux 10中MySql安裝與配置步驟LinuxMySql
- solaris10中安裝oracle核心引數的調整Oracle
- MySQL-安裝配置篇MySql
- 【Mysql】Windows下安裝和配置MysqlMySqlWindows
- Mysql for Linux安裝配置之—— rpm(bundle)安裝MySqlLinux
- Mysql for Linux安裝配置之—— 原始碼安裝MySqlLinux原始碼
- MySQL安裝之二_安裝配置泥潭版MySql
- Solaris下Oracle RAC 11.2.0.4 安裝方法Oracle
- 本地Windows10怎樣配置免安裝版本MySQL?WindowsMySql
- MySQL安裝之一_安裝配置順利版MySql
- Windows 安裝並配置 MySQL 5.6WindowsMySql
- Ubuntu 18.04 安裝配置 MySQL 5.7UbuntuMySql
- MySQL - 安裝時的安全配置MySql
- Mysql安裝及基礎配置MySql
- LNMP--mysql php安裝配置LNMPMySqlPHP
- Solaris 10.5 安裝Oracle 11gR2Oracle
- 安裝MySQL後,需要調整的10個效能配置項MySql
- Mysql for Linux安裝配置之——二進位制安裝MySqlLinux
- win10 mysql安裝Win10MySql
- LINUX 環境 mysql to mysql OGG安裝配置(二)LinuxMySql
- CentOS 7 安裝、配置、使用 PostgreSQL 10 安裝及基礎配置CentOSSQL
- windows安裝及配置mysql5.7WindowsMySql
- MySQL的下載、安裝和配置MySql
- MySQL - 下載與安裝配置(Linux)MySqlLinux
- ubuntu 20.04安裝配置mysql8.0UbuntuMySql
- Solaris中對tar.z進行安裝解除安裝教程詳解
- MySQL 主從複製安裝部署配置MySql
- macOS下MySQL 8.0 安裝與配置教程MacMySql
- jdk+tomcat+mysql一鍵安裝配置JDKTomcatMySql
- MySQL的安裝與配置——詳細教程MySql
- centos7.6 安裝配置 mysql5.7CentOSMySql
- oracle & mysql 驅動程式安裝配置OracleMySql
- MySQL5.7.21免安裝版如何配置MySql
- 【MySQL資料庫】MySQL5.7安裝與配置、視覺化工具安裝和破解MySql資料庫視覺化