The world’s most popular open source database

1.Install MySQL

root@kallen:~# apt-get install mysql-server-5.5 mysql-client-5.5

2.Add Users

(1) 选择数据表

语句例如以下:use mysql;

(2) 在mysql的user表中添加连接用户帐号:

这里不要直接使用INSERT语句加入user记录,使用INSERT可能出现错误:

ERROR 1364 (HY000): Field ‘ssl_cipher’ doesn’t have a default value

只是早期的MYSQL版本号倒没出现这个错误,由于一直都是直接改动user表或直接使用INSERT语句完毕。后来升级MYSQL到5.1的时候,发现可能会出现这个错误。

建议使用GRANT语句进行授权。语句例如以下:

GRANT USAGE ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

上句:

“username”替换为将要授权的用户名,比方clientusr;

“password”替换为clientusr设置的密码;

(3) 可訪问数据表授权

创建好帐户之后,就開始给上面的common user进行数据表授权,步骤3中添加的连接用户默认权限都是“N”的,必须在db表中为该帐户授权,同意其訪问专用数据库。当然超级用户就不说了。

使用以下语句:

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;

3.Install phpmyadmin

用随便一个支持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为安全着想。

4.Can’t connect to MySQL server on ‘localhost’(10038)

查一下你的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

5.安装mysql*.rpm提示conflicts with file from package的解决的方法

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官网.


热门推荐


LNMP环境搭建——MySQL篇的更多相关文章

  1. LNMP环境搭建——PHP篇

    一.源代码安装 1.编译安装 ./configure --prefix=/usr/local/php\ --with-config-file-path=/usr/local/php/etc --wit ...

  2. Linux下-LNMP环境搭建博客网站(全过程)

    通常我们所说的LNMP是指一个网站基本的组织框架,即Linux系统支持,Nginx静态服务,Mysql数据库支持以及PHP动态编程语言支持.目前Mysql数据库被Oracle数据库分析公司收购,其创始 ...

  3. LNMP环境搭建

    LNMP环境搭建 Linux + Nginx + MySQL + PHP PHP是一种脚本语言,当前中国乃至世界上使用PHP语言开发的网站非常普遍 Nginx是一个web服务软件,和apache是一类 ...

  4. 阿里云(ECS)Centos服务器LNMP环境搭建

    阿里云( ECS ) Centos7 服务器 LNMP 环境搭建 前言 第一次接触阿里云是大四的时候,当时在校外公司做兼职,关于智能家居项目的,话说当时俺就只有一个月左右的 php 后台开发经验(还是 ...

  5. LNMP环境搭建:Nginx安装、测试与域名配置

    Nginx作为一款优秀的Web Server软件同时也是一款优秀的负载均衡或前端反向代理.缓存服务软件 2.编译安装Nginx (1)安装Nginx依赖函数库pcre pcre为“perl兼容正则表达 ...

  6. LNMP环境搭建之php安装,wordpress博客搭建

    LNMP环境搭建之php安装,wordpress博客搭建 一.介绍: 1.什么是CGI CGI全称是"通用网关接口"(Common Gateway Interface),HTTP服 ...

  7. Ubuntu16.04 lnmp 环境搭建

    Ubuntu16.04 lnmp 环境搭建 nginx 安装 sudo apt-add-repository ppa:nginx/stablesudo apt-add-repository ppa:o ...

  8. LNMP环境搭建之编译安装指南(php-5.3.27.tar.gz)

    测试环境:CentOS release 6.5 (Final) 软件安装:nginx   mysql-5.5.32-linux2.6-x86_64.tar.gz   php-5.3.27.tar.gz ...

  9. LNMP环境搭建哈哈

    经过一番折腾,终于将LNMP环境搭建完成了.本文介绍的LNMP环境是在windows的Oracle VM VirtualBox中的Centos虚拟机上搭建的,各个软件的版本为:Centos7 + Ng ...

随机推荐

  1. coreseek 段错误 (core dumped) 问题

    coreseek建立索引出现上面问题经过测试发现有下面几个原因: 1. 分词配置文件不存在  uni.lib 2. uni.lib配置文件格式不正确

  2. 【数论】【原根】【动态规划】【bitset】2017四川省赛 K.2017 Revenge

    题意: 给你n(不超过200w)个数,和一个数r,问你有多少种方案,使得你取出某个子集,能够让它们的乘积 mod 2017等于r. 2017有5这个原根,可以使用离散对数(指标)的思想把乘法转化成加法 ...

  3. 【动态规划】POJ2385-Apple Catching

    [题目大意] 有两棵树1和2,奶牛Bessie位于树1下,每个单位时间会有一个苹果从其中一棵树掉下来,同时Bessie也可以移动一次,但是Bessie不希望移动超过W次,问T时间内Bessie最多得到 ...

  4. [HihoCoder1259]A Math Problem

    题目大意: 有一个函数f(n),满足3f(n)*f(2n+1)=f(2n)*(1+3f(n)),f(2n)<6f(n). 我们用g(t)表示f(i)%k=t的i的个数,其中1<=i< ...

  5. 探究Activity(1)--Activity的基本用法

    一.Activity是什么 Activity(活动)是最容易吸引用户的地方,它是一种可以包含用户界面的组件,主要用于和用户进行交互.一个应用程序中应该包括零个或多个Activity. 二.Activi ...

  6. bzoj 1636: [Usaco2007 Jan]Balanced Lineup -- 线段树

    1636: [Usaco2007 Jan]Balanced Lineup Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 772  Solved: 560线 ...

  7. BUG:php7.1 访问yii数据库 自动加端口3306 报错

    跟新完php7.1后访问yii项目出现下图错误 可见数据库链接是已经制指定了端口号9004 但是访问时后续自动加上了3306 原因:换了方式 //这种方式只支持5.6版本php 'db' => ...

  8. 星际争霸 虚空之遗 人族5BB 操作流程

    人族5BB rush timing 3min-3min30 一波战术,对面双开不侦察应该就GG了. 14农民BS,建议在第一个BS后的100矿,马上接上一个BS堵口,基本上对面是侦察不到的,特别是内双 ...

  9. 用GDB 调试Java程序

      陈皓 http://blog.csdn.net/haoel 背景 想要使用GDB调试程序,就需要用GNU的编译器编译程序.如:用GCC编译的C/C++的程序,才能用GDB调试.对于Java程序也是 ...

  10. 基本C库函数

    当编写驱动程序时,一般情况下不能使用C标准库的函数.Linux内核也提供了与标准库函数功能相同的一些函数,但二者还是稍有差别. 类别 函数名 功能 函数形成 参数 描述 字符串转换 simple_st ...