The world’s most popular open source databasephp
root@kallen:~# apt-get install mysql-server-5.5 mysql-client-5.5
(1) 選擇數據表
語句例如如下:use mysql;
(2) 在mysql的user表中添加鏈接用戶賬號:
這裏不要直接使用INSERT語句加入user記錄,使用INSERT可能出現錯誤:html
ERROR 1364 (HY000): Field ‘ssl_cipher’ doesn’t have a default valuemysql
只是早期的MYSQL版本號倒沒出現這個錯誤,因爲一直都是直接改動user表或直接使用INSERT語句完畢。後來升級MYSQL到5.1的時候,發現可能會出現這個錯誤。linux
建議使用GRANT語句進行受權。語句例如如下:web
GRANT USAGE ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
上句:sql
「username」替換爲將要受權的用戶名,比方clientusr;
「password」替換爲clientusr設置的密碼;數據庫
(3) 可訪問數據表受權apache
建立好賬戶以後,就開始給上面的common user進行數據表受權,步驟3中添加的鏈接用戶默認權限都是「N」的,必須在db表中爲該賬戶受權,贊成其訪問專用數據庫。固然超級用戶就不說了。ubuntu
使用如下語句:vim
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON tablename.* TO 'username'@'localhost' IDENTIFIED BY 'password';
本語句中的權限依據實際需要肯定:
「tablename」替換爲受權訪問的數據表table名
「username」 是步驟2受權用戶名
「password」 是步驟2受權用戶的設置密碼
這樣就爲該用戶授予了對某數據表的SELECT, INSERT, UPDATE, DELETE, CAREATE, DROP
權限。
(4) 生效受權,建立完畢
一句話就能夠:FLUSH PRIVILEGES;
用隨便一個支持PHP的web服務器(如Apache、Nginx、Lighttpd)。下載phpmyadmin。裝之。
sudo apt-get install phpmyadmin #注意這是安裝到/usr/share/phpmyadmin
在ubuntu下。sudo apt-getinstall phpmyadmin
後會有一些設置,如選擇服務器、密碼設定等等內容。
安裝完畢後,訪問http://localhost/phpmyadmin會出現404錯誤,這是因爲沒有將phpmyadmin文件夾映射到apache文件夾如下,執行如下命令就能夠:
sudo ln -s /usr/share/phpmyadmin /var/www/html
[常見錯誤]
(1) 安裝錯誤:
Error: Package: php54w-tidy-5.4.41-1.w6.x86_64 (webtatic)
Requires: libtidy-0.99.so.0()(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest
需要安裝libtidy-0.99.so:
[root@amtt02 html]# rpm -ivh libtidy-0.99.0-19.20070615.1.el6.x86_64.rpm
(2) 訪問錯誤:
在http.conf文件里加入:
<Directory 「/usr/share/phpmyadmin/」>
AllowOverride None
Order allow,deny
Allow from all
</Directory>
service httpd restart
以後。就能成功啓動httpd服務了。問題解決。
訪問phpMyAdmin提示:
配置文件權限錯誤,沒法寫入!
解決的方法:
chmod -R 755 ./phpmyadmin
這樣設置下phpMyAdmin文件夾權限屬性爲755就可以訪問了。原來phpMyAdmin必須在755權限下才幹夠執行。
注意:在777下也是錯誤的。預計是phpMyAdmim爲安全着想。
查一下你的MYSQL用戶表裏, 是否贊成遠程鏈接
(1)給用戶受權
mysql>grant all privileges on *.*to'root'@'%' identified by 'youpassword' with grant option;
mysql>flush privileges;
(2)改動/etc/mysql/my.conf
找到bind-address =127.0.0.1
這一行
改成bind-address =0.0.0.0
就能夠
root@kallen:/etc/selinux# vim /etc/mysql/
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
# bind-address = 127.0.0.1
# Remote Access to MySQL on port 3306
# Kallen Ding, Jun 11 2015
bind-address = 0.0.0.0
Preparing... ########################################### [100%]
file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/latin1.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/cp1250.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/cp1256.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/cp1257.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/cp850.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/cp852.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/cp866.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/dec8.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/geostd8.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/greek.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/hebrew.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/hp8.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/keybcs2.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/koi8r.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/koi8u.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/latin2.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/latin5.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/latin7.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/macce.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/macroman.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/swe7.xml from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/dutch/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/english/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/estonian/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/french/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/german/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/greek/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/hungarian/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/italian/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/japanese/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/korean/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/norwegian-ny/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/norwegian/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/polish/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/portuguese/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/romanian/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/russian/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/serbian/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/slovak/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/spanish/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/swedish/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/bin/mysql_config from install of MySQL-devel-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/bin/mysql from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/share/man/man1/mysql_config.1.gz from install of MySQL-devel-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/bin/msql2mysql from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/bin/mysql_waitpid from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/bin/mysqlaccess from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/bin/mysqladmin from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/bin/mysqlbinlog from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/bin/mysqlcheck from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/bin/mysqldump from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/bin/mysqlimport from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/bin/mysqlshow from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/bin/mysqlslap from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/share/man/man1/mysql.1.gz from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/share/man/man1/mysql_find_rows.1.gz from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/share/man/man1/mysql_waitpid.1.gz from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/share/man/man1/mysqlaccess.1.gz from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/share/man/man1/mysqladmin.1.gz from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/share/man/man1/mysqldump.1.gz from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/share/man/man1/mysqlshow.1.gz from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/share/man/man1/mysqlslap.1.gz from install of MySQL-client-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/bin/my_print_defaults from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
file /usr/share/man/man1/my_print_defaults.1.gz from install of MySQL-server-5.5.43-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
【解決的方法】
[root@kallen MySQL-5.5]# yum -y remove mysql-libs-5.1.71-1.el6.x86_64
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Remove Process
Resolving Dependencies
--> Running transaction check ---> Package mysql-libs.x86_64 0:5.1.71-1.el6 will be erased --> Processing Dependency: libmysqlclient.so.16()(64bit)for package:2:postfix-2.6.6-2.2.el6_1.x86_64 --> Processing Dependency: libmysqlclient.so.16()(64bit)for package: mysql-5.1.71-1.el6.x86_64 --> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit)for package:2:postfix-2.6.6-2.2.el6_1.x86_64 --> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit)for package: mysql-5.1.71-1.el6.x86_64 --> Processing Dependency: libmysqlclient_r.so.16()(64bit)for package: mysql-5.1.71-1.el6.x86_64 --> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit)for package: mysql-5.1.71-1.el6.x86_64 --> Processing Dependency: mysql-libs for package:2:postfix-2.6.6-2.2.el6_1.x86_64 --> Processing Dependency: mysql-libs =5.1.71-1.el6 for package: mysql-5.1.71-1.el6.x86_64 --> Running transaction check ---> Package mysql.x86_64 0:5.1.71-1.el6 will be erased ---> Package postfix.x86_64 2:2.6.6-2.2.el6_1 will be erased --> Processing Dependency: /usr/sbin/sendmail for package: cronie-1.4.4-12.el6.x86_64 --> Running transaction check ---> Package cronie.x86_64 0:1.4.4-12.el6 will be erased --> Processing Dependency: cronie =1.4.4-12.el6 for package: cronie-anacron-1.4.4-12.el6.x86_64 --> Running transaction check ---> Package cronie-anacron.x86_64 0:1.4.4-12.el6 will be erased --> Processing Dependency: /etc/cron.d for package: crontabs-1.10-33.el6.noarch --> Processing Dependency: /etc/cron.d for package: sysstat-9.0.4-22.el6.x86_64 --> Restarting Dependency Resolution with new changes. --> Running transaction check ---> Package crontabs.noarch 0:1.10-33.el6 will be erased ---> Package sysstat.x86_64 0:9.0.4-22.el6 will be erased --> Finished Dependency Resolution Dependencies Resolved
============================================================================================================================================= Package Arch Version Repository Size
============================================================================================================================================= Removing:
mysql-libs x86_64 5.1.71-1.el6 @anaconda-RedHatEnterpriseLinux-201311111358.x86_64/6.5 4.0 M
Removing for dependencies:
cronie x86_64 1.4.4-12.el6 @anaconda-RedHatEnterpriseLinux-201311111358.x86_64/6.5 174 k
cronie-anacron x86_64 1.4.4-12.el6 @anaconda-RedHatEnterpriseLinux-201311111358.x86_64/6.5 43 k
crontabs noarch 1.10-33.el6 @anaconda-RedHatEnterpriseLinux-201311111358.x86_64/6.5 2.4 k
mysql x86_64 5.1.71-1.el6 @Server 2.4 M
postfix x86_64 2:2.6.6-2.2.el6_1 @anaconda-RedHatEnterpriseLinux-201311111358.x86_64/6.5 9.7 M
sysstat x86_64 9.0.4-22.el6 @Server 824 k
Transaction Summary
============================================================================================================================================= Remove 7 Package(s)
Installed size:17 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : mysql-5.1.71-1.el6.x86_64 1/7
Erasing : sysstat-9.0.4-22.el6.x86_64 2/7
Erasing : cronie-1.4.4-12.el6.x86_64 3/7
Erasing : cronie-anacron-1.4.4-12.el6.x86_64 4/7
Erasing : crontabs-1.10-33.el6.noarch 5/7
Erasing :2:postfix-2.6.6-2.2.el6_1.x86_64 6/7
Erasing : mysql-libs-5.1.71-1.el6.x86_64 7/7
Verifying : cronie-anacron-1.4.4-12.el6.x86_64 1/7
Verifying :2:postfix-2.6.6-2.2.el6_1.x86_64 2/7
Verifying : mysql-libs-5.1.71-1.el6.x86_64 3/7
Verifying : crontabs-1.10-33.el6.noarch 4/7
Verifying : sysstat-9.0.4-22.el6.x86_64 5/7
Verifying : cronie-1.4.4-12.el6.x86_64 6/7
Verifying : mysql-5.1.71-1.el6.x86_64 7/7
Removed:
mysql-libs.x86_64 0:5.1.71-1.el6
Dependency Removed:
cronie.x86_64 0:1.4.4-12.el6 cronie-anacron.x86_64 0:1.4.4-12.el6 crontabs.noarch 0:1.10-33.el6 mysql.x86_64 0:5.1.71-1.el6
postfix.x86_64 2:2.6.6-2.2.el6_1 sysstat.x86_64 0:9.0.4-22.el6
Complete!
[root@kallen MySQL-5.5]# rpm -ivh MySQL-server-5.5.43-1.el6.x86_64.rpm MySQL-client-5.5.43-1.el6.x86_64.rpm MySQL-devel-5.5.43-1.el6.x86_64.rpm MySQL-embedded-5.5.43-1.el6.x86_64.rpm MySQL-shared-5.5.43-1.el6.x86_64.rpm MySQL-shared-compat-5.5.43-1.el6.x86_64.rpm MySQL-test-5.5.43-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-devel ########################################### [14%]
2:MySQL-client ########################################### [29%]
3:MySQL-test ########################################### [43%]
4:MySQL-embedded ########################################### [57%]
5:MySQL-shared-compat ########################################### [71%]
6:MySQL-shared ########################################### [86%]
7:MySQL-server ########################################### [100%]
150724 7:39:13[Note] /usr/sbin/mysqld (mysqld 5.5.43) starting as process 8723 ...
150724 7:39:13[Note] /usr/sbin/mysqld (mysqld 5.5.43) starting as process 8730 ...
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server,then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h amtt password 'new-password'
Alternatively you can run:
/usr/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.
Please report any problems at http://bugs.mysql.com/
6.源代碼安裝MySQL
(1)安裝Cmake
root@kallen ~]# yum install cmake28 cmake28-gui
備註:
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql //安裝文件夾
-DINSTALL_DATADIR=/usr/local/mysql/data //數據庫存放文件夾
-DDEFAULT_CHARSET=utf8 //使用utf8字符
-DDEFAULT_COLLATION=utf8_general_ci //校驗字符
-DEXTRA_CHARSETS=all //安裝所有擴展字符集
-DENABLED_LOCAL_INFILE=1//贊成從本地導入數據
(2)安裝ncurses-devel
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:83(MESSAGE):
Curses library NOT found. Please install appropriate package,
remove CMakeCache.txt AND rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat AND derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:127(FIND_CURSES)
cmake/readline.cmake:217(MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:268(MYSQL_CHECK_READLINE)
[root@kallen ~]# rpm -ivh ncurses-devel-5.7-3.20090208.el6.x86_64.rpm
warning: ncurses-devel-5.7-3.20090208.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY
Preparing... ########################################### [100%]
1:ncurses-devel ########################################### [100%]
(3)刪除CMakeCache.txt
[root@kallen mysql-5.5.21]# rm -rf CMakeCache.txt
(4)編譯Mysql
[root@kallen mysql-5.5.21]# /usr/bin/cmake28 -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
[root@kallen mysql-5.5.21]# make && make install
【參考文章】Mysql源代碼安裝
【注】文中引用圖片來自MySQL官網.