1. 程式人生 > >centos 解壓安裝mysql

centos 解壓安裝mysql

[[email protected] local]#yum install libaio
[[email protected] local]#yum-y install autoconf
[[email protected] local]#yum install gcc gcc-c++ ncurses-devel perl

[[email protected] local]# groupadd mysql

[[email protected] local]# useradd -r -g mysql mysql
[[email protected]
local]# cd /usr/local
[[email protected] local]# tar zxvf /usr/local/mysql-5.6.11-linux-glibc2.5-x86_64.tar.gz
[[email protected] local]# ln -s /usr/local/mysql-5.6.11-linux-glibc2.5-x86_64 mysql
[[email protected] local]# cd mysql
[[email protected] mysql]# chown -R mysql .
[[email protected]
mysql]# chgrp -R mysql .
[[email protected] mysql]# ls -la
total 84
drwxr-xr-x. 13 mysql mysql  4096 May  2 03:54 .
drwxr-xr-x. 13 root  root   4096 May  2 03:55 ..
drwxr-xr-x.  2 mysql mysql  4096 May  2 03:54 bin
-rw-r--r--.  1 mysql mysql 17987 Apr  5 08:27 COPYING
drwxr-xr-x.  3 mysql mysql  4096 May  2 03:53 data
drwxr-xr-x.  2 mysql mysql  4096 May  2 03:53 docs
drwxr-xr-x.  3 mysql mysql  4096 May  2 03:53 include
-rw-r--r--.  1 mysql mysql  7468 Apr  5 08:27 INSTALL-BINARY
drwxr-xr-x.  3 mysql mysql  4096 May  2 03:53 lib
drwxr-xr-x.  4 mysql mysql  4096 May  2 03:53 man
drwxr-xr-x. 10 mysql mysql  4096 May  2 03:53 mysql-test
-rw-r--r--.  1 mysql mysql  2552 Apr  5 08:27 README
drwxr-xr-x.  2 mysql mysql  4096 May  2 03:54 scripts
drwxr-xr-x. 28 mysql mysql  4096 May  2 03:53 share
drwxr-xr-x.  4 mysql mysql  4096 May  2 03:54 sql-bench
drwxr-xr-x.  3 mysql mysql  4096 May  2 03:54 support-files
[
[email protected]
mysql]# scripts/mysql_install_db --user=mysql
WARNING: The host 'CentOS' could not be looked up with ./bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !


Installing MySQL system tables...2013-05-02 04:21:14 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-05-02 04:21:14 6416 [Note] InnoDB: The InnoDB memory heap is disabled
2013-05-02 04:21:14 6416 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-05-02 04:21:14 6416 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-05-02 04:21:14 6416 [Note] InnoDB: Using Linux native AIO
2013-05-02 04:21:14 6416 [Note] InnoDB: Using CPU crc32 instructions
2013-05-02 04:21:14 6416 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-05-02 04:21:14 6416 [Note] InnoDB: Completed initialization of buffer pool
2013-05-02 04:21:14 6416 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2013-05-02 04:21:14 6416 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2013-05-02 04:21:14 6416 [Note] InnoDB: Database physically writes the file full: wait...
2013-05-02 04:21:14 6416 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2013-05-02 04:21:14 6416 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2013-05-02 04:21:15 6416 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2013-05-02 04:21:15 6416 [Warning] InnoDB: New log files created, LSN=45781
2013-05-02 04:21:15 6416 [Note] InnoDB: Doublewrite buffer not found: creating new
2013-05-02 04:21:15 6416 [Note] InnoDB: Doublewrite buffer created
2013-05-02 04:21:15 6416 [Note] InnoDB: 128 rollback segment(s) are active.
2013-05-02 04:21:15 6416 [Warning] InnoDB: Creating foreign key constraint system tables.
2013-05-02 04:21:15 6416 [Note] InnoDB: Foreign key constraint system tables created
2013-05-02 04:21:15 6416 [Note] InnoDB: Creating tablespace and datafile system tables.
2013-05-02 04:21:15 6416 [Note] InnoDB: Tablespace and datafile system tables created.
2013-05-02 04:21:15 6416 [Note] InnoDB: Waiting for purge to start
2013-05-02 04:21:15 6416 [Note] InnoDB: 5.6.11 started; log sequence number 0
2013-05-02 04:21:17 6416 [Note] Binlog end
2013-05-02 04:21:17 6416 [Note] InnoDB: FTS optimize thread exiting.
2013-05-02 04:21:17 6416 [Note] InnoDB: Starting shutdown...
2013-05-02 04:21:19 6416 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK


Filling help tables...2013-05-02 04:21:19 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-05-02 04:21:19 6439 [Note] InnoDB: The InnoDB memory heap is disabled
2013-05-02 04:21:19 6439 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-05-02 04:21:19 6439 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-05-02 04:21:19 6439 [Note] InnoDB: Using Linux native AIO
2013-05-02 04:21:19 6439 [Note] InnoDB: Using CPU crc32 instructions
2013-05-02 04:21:19 6439 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-05-02 04:21:19 6439 [Note] InnoDB: Completed initialization of buffer pool
2013-05-02 04:21:19 6439 [Note] InnoDB: Highest supported file format is Barracuda.
2013-05-02 04:21:19 6439 [Note] InnoDB: 128 rollback segment(s) are active.
2013-05-02 04:21:19 6439 [Note] InnoDB: Waiting for purge to start
2013-05-02 04:21:19 6439 [Note] InnoDB: 5.6.11 started; log sequence number 1625977
2013-05-02 04:21:19 6439 [Note] Binlog end
2013-05-02 04:21:19 6439 [Note] InnoDB: FTS optimize thread exiting.
2013-05-02 04:21:19 6439 [Note] InnoDB: Starting shutdown...
2013-05-02 04:21:21 6439 [Note] InnoDB: Shutdown completed; log sequence number 1625987
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 CentOS 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!


The latest information about MySQL is available on the web at


  http://www.mysql.com


Support MySQL by buying support/licenses at http://shop.mysql.com


New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings


[[email protected] mysql]# chown -R root .
[[email protected] mysql]# chown -R mysql data
[[email protected] mysql]# ls support-files
binary-configure  magic  my-default.cnf  mysqld_multi.server  mysql-log-rotate
[[email protected] mysql]# cp support-files/my-default.cnf /etc/my.cnf
[[email protected] mysql]# cp support-files/mysql.server /etc/init.d/mysql
[[email protected] mysql]# bin/mysqld_safe --user=mysql &
[1] 6468
[[email protected] mysql]# 130502 04:23:50 mysqld_safe Logging to '/usr/local/mysql/da
130502 04:23:50 mysqld_safe Starting mysqld daemon with databases from /usr/loca
[[email protected] mysql]# mysql
-bash: mysql: command not found
[[email protected] mysql]# bin/mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.11 MySQL Community Server (GPL)


Copyright (c) 2000, 2013, 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.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> exit
Bye
[[email protected] mysql]# bin/mysqladmin -u root password '1234';
[[email protected] mysql]# bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.11 MySQL Community Server (GPL)


Copyright (c) 2000, 2013, 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.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)


mysql> exit
Bye
[[email protected] mysql]# cd
[[email protected] ~]# cd /usr/lib/mysql/
-bash: cd: /usr/lib/mysql/: No such file or directory
[[email protected] ~]# cd /usr/local/mysql/
[[email protected] mysql]# ls -la
total 88
drwxr-xr-x. 13 root  mysql  4096 May  2 04:21 .
drwxr-xr-x. 13 root  root   4096 May  2 03:55 ..
drwxr-xr-x.  2 root  mysql  4096 May  2 03:54 bin
-rw-r--r--.  1 root  mysql 17987 Apr  5 08:27 COPYING
drwxr-xr-x.  5 mysql mysql  4096 May  2 04:23 data
drwxr-xr-x.  2 root  mysql  4096 May  2 03:53 docs
drwxr-xr-x.  3 root  mysql  4096 May  2 03:53 include
-rw-r--r--.  1 root  mysql  7468 Apr  5 08:27 INSTALL-BINARY
drwxr-xr-x.  3 root  mysql  4096 May  2 03:53 lib
drwxr-xr-x.  4 root  mysql  4096 May  2 03:53 man
-rw-r--r--.  1 root  root    943 May  2 04:21 my.cnf
drwxr-xr-x. 10 root  mysql  4096 May  2 03:53 mysql-test
-rw-r--r--.  1 root  mysql  2552 Apr  5 08:27 README
drwxr-xr-x.  2 root  mysql  4096 May  2 03:54 scripts
drwxr-xr-x. 28 root  mysql  4096 May  2 03:53 share
drwxr-xr-x.  4 root  mysql  4096 May  2 03:54 sql-bench
drwxr-xr-x.  3 root  mysql  4096 May  2 03:54 support-files
[[email protected] mysql]# cd
[[email protected] ~]# echo "export PATH=$PATH:/usr/local/mysql/bin" >>/etc/profile
[[email protected] ~]# source /etc/profile
[[email protected] ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.11 MySQL Community Server (GPL)


Copyright (c) 2000, 2013, 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.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)


mysql> exit
Bye
[[email protected] ~]# mysql stop;
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[[email protected] ~]# service mysql stop;
Shutting down MySQL..130502 05:37:55 mysqld_safe mysqld from pid file /usr/local/mysql/data/CentOS.pid ended
 SUCCESS!
[1]+  Done                    bin/mysqld_safe --user=mysql  (wd: /usr/local/mysql)
(wd now: ~)
[[email protected] ~]# service mysql start;
Starting MySQL. SUCCESS!
[[email protected] ~]# service mysql stop;
Shutting down MySQL.. SUCCESS!
[[email protected] ~]# ls -la /etc/init.d/mysql
-rwxr-xr-x. 1 root root 10650 May  2 04:23 /etc/init.d/mysql
[[email protected] ~]# cd /etc
[[email protected] etc]# ln -s rc.d/init.d .
ln: creating symbolic link `./init.d': File exists
[[email protected] etc]# chkconfig --add mysql
[[email protected] etc]# chkconfig --level 345 mysql on
[[email protected] etc]# cd
[[email protected] ~]# service mysql start;
Starting MySQL. SUCCESS!
[[email protected] ~]#

相關推薦

centos 安裝mysql

[[email protected] local]#yum install libaio [[email protected] local]#yum-y install autoconf [[email protected] local]#yu

mysql安裝-CentOS6下安裝mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz

cannot x86 sed 一次 article www. 連接 初始 fresh 刪除已經安裝版本 yum list installed mysql [root@localhost ~]# yum list installed mysql Loaded plugi

win10安裝mysql方法及遇見的問題(缺少MSVCR120.dll檔案、服務無法啟動)

WIN10系統MYSQL的下載與安裝詳細教程第一步:下載MySQL具體過程如下: 1.選擇要下載的型別,64位還是32位:*點選download後就會到下圖的下載介面,這時最顯眼的是sign up,有些人會覺得需要先註冊賬號才能下載,點選圖中紅色的,直接免註冊下載。平時再下載

【Linux】CentOS 7.4 安裝 MySQL 8.0.12

style prope error shared false 添加 tab code plain 安裝環境/工具   1、Linux(CentOS 7.4版)   2、mysql-8.0.12-el7-x86_64.tar.gz 安裝步驟   參考:https://dev.

mysql安裝

sed root 改密 roo 生成隨機密碼 image 內容 ini文件 -a 一、 下載好後解壓文件,解壓的內容如圖,您可以把內容解壓到想要的位置,本例解壓到“D:\phpweb\mysql”, 還有一個問題新版沒有data名稱的文件夾,這個文件夾顧名思義是放數據文件

Win7安裝MySQL

img images ica from lan pan 操作 mov 用戶 1. 下載MySQL 訪問https://dev.mysql.com/downloads/mysql/5.6.html#downloads,下載操作系統對應的版本(無賬號需先註冊一個),以mysql

Windows 64 位 mysql 5.7以上版本包安裝

mysql msql安裝 mysql官網下載地址:https://dev.mysql.com/downloads/mysql/ 以5.7.21版本為例 首先安裝包解壓後,沒有網上教程裏面提到的data文件夾和my-default.ini,如下圖所示 配置環境變量請參照網上教程,這個一般沒有問題 主要

win10下mysql-8.0.12安裝教程

l數據庫 def .net 大連 技術 src 運行命令 技術分享 roo 內容轉載於:https://blog.csdn.net/hust_hqq/article/details/80572133 在他之上添加了一個:服務名無效的解決方法 1.官網下載安裝包 網址:htt

CentOS 7安裝PHP7.1.21

sap 依賴 string splay str 動態生成 dev nginx target 下載php yum install -y wget wget http://cn2.php.net/distributions/php-7.1.21.tar.gz 解壓

MYSQL安裝及遇到的錯誤

1 安裝 在 MYSQL官網 進行下載相應的解壓版本,然後放在你所想的目錄下。 解壓內容如下: 然後我們需要去建立一個名為my.ini檔案,注意檔案字尾一定要是.ini結尾,如果檔案字尾隱藏了,可以將其勾選上,如圖: 建立檔案:my.ini。 其內容如下: [cli

mysql安裝遇到的問題

啟動後,服務右鍵全是灰色, 應用程式無法正常啟動(0xc000007b)。請單擊“確定”關閉應用程式。 解決辦法:安裝DirectX 9.0c 2、mysqld install 回車  ,沒問題,但是net start mysql 出錯  錯誤 1053:服務沒有及時

版本mysql安裝

1. 下載mysql的 資料庫到oracle 官方網站 2. 解壓檔案 3.控制檯進入檔案的bin目錄 4.配置mysql的配置檔案my.ini my.ini配置檔案配置如下 #設定編碼 character_set_server = utf8 #設定資料檔案的儲

win7下安裝MySQL(版本:5.7.21) 完全解決MySQL錯誤2003:Can’t connect to MySQL server (10060)

step1:下載 我安裝的日期是2018年3月2日,版本為5.7.21,我的電腦是win7 64位,根據自己的系統選擇相應版本,點選Download,如圖所示: 然後跳到下面這個介面,注意此時不需要註冊也不需要登入,直接點選紅色部分: 最好選擇非系統

win7下安裝MySQL(版本:5.7.21)

按照網上的教程,花了半個小時安裝好了解壓版MySQL。安裝過程中踩了幾個坑,廢話不多說,上過程。step1:下載我安裝的日期是2018年3月2日,版本為5.7.21,我的電腦是win7 64位,根據自己的系統選擇相應版本,點選Download,如圖所示:然後跳到下面這個介面,

MySQL安裝圖解

1.解壓 MySQL安裝檔案分為兩種,一種是msi格式的,一種是zip格式的。如果是msi格式的可以直接點選安裝,按照它給出的安裝提示進行安裝(相信大家的英文可以看懂英文提示),一般MySQL將會安裝在C:\Program Files\MySQL\MySQL Serv

win10下mysql-8.0.11安裝教程

根據網上的一些教程,安裝mysql,期間遇到了許多問題,記錄下來。1.官網下載安裝包網址:https://dev.mysql.com/downloads/選擇MySQL Community Server作業系統選擇Windows選擇下載紅色方框中的檔案直接跳過,不登入,直接下

mysql安裝配置與設定密碼

本文整合百度經驗和網上資源,僅為本人安裝過程中參考資源的整合。參考連結: http://jingyan.baidu.com/article/f3ad7d0ffc061a09c3345bf0.html http://www.jb51.net/article/105962.ht

Ubuntu 12.10 下MySQL 5.1.65 安裝

1. 下載http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.65-linux-i686-glibc23.tar.gz2、解壓gunzip mysql-5.1.65-linux-i686-glibc23.tar.gz

安裝mysql瘦身

在製作MYPM一鍵安裝程式中,打包了jdk,tomcat 和mysql 當時下載的免安裝解壓版的mysql是mysql-noinstall-5.1.53-win32.zip,好傢伙115M 解太后的mysql 484M 我神呀,加上JDK 什麼的這安裝程沒壓縮前得近700M 太讓人受不了,經測試發現 Emb

mysql-5.7.20-winx64.zip Zip版、MySQL安裝

1.  zip下載地址:2.官方文件位置:http://dev.mysql.com/doc/refman/5.7/en/installing.html3.將檔案解壓到你喜歡的位置,我解壓到了C:盤根目錄4.在壓縮包根目錄下建立my.ini 檔案,如圖:檔案裡面如圖新增[mys