centos7.2_x64安裝mysql.tar.gz

來源:互聯網
上載者:User

標籤:ati   files   資料   重新整理   please   contain   end   tin   檔案   

1.解壓 tar mysql-5.6.17-linux-glibc2.5-i686.tar.gz

2.把解壓好的檔案移動到/usr/local/mysql 下 cp -r mysql-5.6.17-linux-glibc2.5-i686 /usr/local/mysql

3.添加系統mysql組和mysql使用者:執行命令:groupadd mysql和useradd -r -g mysql mysql

4.安裝資料庫:

1).修改目前的目錄擁有者為mysql使用者:執行命令 chown -R mysql:mysql ./

2).安裝資料庫:執行命令 ./scripts/mysql_install_db --user=mysql

可能出現的問題:

-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file or directory
提示注釋器錯誤,沒有/usr/bin/perl檔案或者檔案,解決辦法(安裝perl跟perl-devel即可):執行  yum -y install perl perl-devel

Can‘t locate Data/Dumper.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/l
ib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./scripts/mysql_install_db line 42. 

解決辦法:yum -y install autoconf

3)修改目前的目錄擁有者為root使用者:執行命令 chown -R root:root ./

4)修改當前data目錄擁有者為mysql使用者:執行命令 chown -R mysql:mysql data

到此資料庫安裝完畢

Starting MySQL...The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).

 

2 原因

 

沒有初始化許可權表

 

 

 

3 解決辦法

 

#cd /usr/local/mysql(進入mysql安裝目錄)
#chown -R mysql.mysql .
#su - mysql
$cd server
$scripts/mysql_install_db

 

 

 

4 本人解決過程

 

[[email protected] ~]# cd/usr/local/mysql

 

[[email protected] mysql]# chown -Rmysql.mysql .
[[email protected] mysql]# su - mysql
[[email protected] ~]$ cd /usr/local/mysql
[[email protected] mysql]$scripts/mysql_install_db
Installing MySQLsystem 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 localhost.localdomain password‘new-password‘

 

Alternatively you can run:
./bin/mysql_secure_installation

 

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

 

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!

 

[[email protected] mysql]$ /usr/local/mysql/bin/mysqld_safe --user=mysql&
[1] 11767
[[email protected] mysql]$ 120502 07:01:17 mysqld_safe Logging to‘/usr/local/mysql/data/localhost.localdomain.err‘.
120502 07:01:17 mysqld_safe Starting mysqld daemon with databasesfrom /usr/local/mysql/data
[[email protected] mysql]$ /etc/rc.d/init.d/mysql status
MySQL running(11830)                                     [  OK  ]
[[email protected] mysql]$ /etc/rc.d/init.d/mysql start
StartingMySQL                                            [  OK  ]

 

 

 從任何主機上使用root使用者,密碼:youpassword(你的root密碼)串連到mysql伺服器:

# mysql -u root -proot 
mysql>GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘youpassword‘ WITH GRANT OPTION;

操作完後切記執行以下命令重新整理許可權 

FLUSH PRIVILEGES

 

centos7.2_x64安裝mysql.tar.gz

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.