centos5安装mysql 5.6.19 mysql-devel_Centos5.8 安装 MySQL5.6.19

查看已经安装的mysql:

sudo yum list installed |grep mysql

删除

sudo yum remove mysql

安装

sudo rpm -ivh MySQL-server-5.6.19-1.rhel5.x86_64.rpm

会发现mysql已经被添加到/etc/init.d/

查看服务状态

sudo /sbin/service mysql status

启动服务

sudo /sbin/service mysql start

ps查看, 服务运行在mysql用户下,

检查启动参数

sudo /sbin/chkconfig –list mysql

mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off

已经添加到系统自启动

my.cnf在 /usr 下, 添加以下基本参数

join_buffer_size = 64M

sort_buffer_size = 4M

read_rnd_buffer_size = 4M

key_buffer_size=16M

max_allowed_packet=16M

修改默认端口会遇到selinux的权限问题, 具体可以看

https://blogs.oracle.com/jsmyth/entry/selinux_and_mysql

可以通过 sudo /usr/sbin/semanage port -l 查看当前的端口状态

semanage port -a -t mysqld_port_t -p tcp 6033

就可以指定其他端口了

#########

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !

You will find that password in ‘/home/milton/.mysql_secret’.

You must change that password on your first connect,

no other statement but ‘SET PASSWORD’ will be accepted.

See the manual for the semantics of the ‘password expired’ flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.

This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

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 /usr/my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

#########

编译安装

需要预先安装ncurses-devel, 否则会报错”Curses library not found”.

sudo yum install ncurses-devel

cmake需要用root权限运行:

sudo cmake -DCMAKE_INSTALL_PREFIX=/opt/mysql

-DMYSQL_DATADIR=/opt/mysql/data -DWITH_INNOBASE_STORAGE_ENGINE=1

-DMYSQL_TCP_PORT=6033 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8

-DDEFAULT_COLLATION=utf8_general_ci

添加用户和组

shell> sudo groupadd mysql

shell> sudo useradd -r -g mysql mysql

# cd /opt/mysql

# sudo chown -R mysql .

# sudo chgrp -R mysql .

安装测试数据

# sudo scripts/mysql_install_db –user=mysql

显示如下:

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 ML-M0 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

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

再修改用户

# sudo chown -R root .

# sudo chown -R mysql data

启动服务

# sudo bin/mysqld_safe –user=mysql &

添加到系统启动

# sudo cp support-files/mysql.server /etc/rc.d/init.d/mysqld

# sudo chkconfig --add mysqld

Centos 6.3 压缩包安装MySQL5.6.2x

# cd /opt/mysql

#tar zxvf mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz

#ln -s mysql-advanced-5.6.23-linux-glibc2.5-x86_64 mysql

# cd mysql

#--- install &init

#sudo chown -R mysql:mysql .

#sudo ./scripts/mysql_install_db --user=mysql

#---start the server (这边加 --user=mysql 的时候不成功, 后来不加这个才正常启动的)

#sudo ./bin/mysqld_safe &[1] 3492[root@racnote1 mysql]#150324 16:33:40 mysqld_safe Logging to '/usr/local/mysql/data/racnote1.err'.150324 16:33:40 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

Ctrl+C

#---add it to the service

#sudo cp support-files/mysql.server /etc/init.d/mysql.server

#sudo vi /etc/init.d/mysql.serverfind "basedir=", add the path to mysql installation, e.g. "basedir=/opt/mysql/mysql"#sudo chkconfig --list

#sudo chkconfig --add mysql.server

#sudo chkconfig --list

#---initialize the root password

#sudo ./bin/mysql_secure_installation

#--- link the mysql executable to /usr/bin

# cd/usr/local/bin

#sudo ln -s /opt/mysql/mysql/bin/mysql mysql

Ncurses是一个能提供功能键定义(快捷键),屏幕绘制以及基于文本终端的图形互动功能的动态库。 Ncurses是一个能提供基于文本终端窗口功能的动态库. Ncurses可以: 只要您喜欢,您可以使用整个屏幕 创建和管理一个窗口 使用8种不同的彩色 为您的程序提供鼠标支持 使用键盘上的功能键 Ncurses可以在任何遵循ANSI/POSIX标准的UNIX系统上运行,除此之外,它还可以从系统数据库中检测终端的属性, 并且自动进行调整,提供一个不受终端约束的接口.因此,Ncurses可以在不同的系统平台和不同的终端上工作的非常好. mc工具集就是一个用ncurses写的很好的例子,而且在终端上系统核心配置的界面同样是用ncurses编写的. NCURSES库简介在使用电传终端作为计算机输出设备的那个年代,电传终端是和计算机分开放置的,并通过串行电缆连接。终端的配置通过发送一系列字节完成。所有的终端控制操作:改变光标在屏幕上的位置,清除屏幕某一区域的内容,屏幕滚动,切换显示模式,给文字添加下划线,改变字符的外观、颜色、亮度等等,也是通过这样一系列字节实现的。由于这些连续的控制字节以一个转义字符“0x1B”(即ESC键)作为起始字节,所以这种控制序列叫做转义序列。即使在当今,我们也可以向终端仿真程序发送转义序列,得到和当年电传打字终端相同的显示效果。 假设你想在终端(或终端仿真窗口)输出一段彩色的文字,可以将以下这段转义序列输入到你的字符控制台(或控制台窗口): echo "^[[0;31;40mIn Color" 在这里 “^[” 就是所谓的转义字符。(注意:“^[” 是一个字符,不是依次键入“^”和“[”字符。要输出“^[”,必须按下Ctrl-V再按下ESC键)执行以上的命令,就应该可以看见“In Color”变为红色了(译者注:试更改转义字符各分号间的参数,看看会有什么结果)。以后输出的文本信息都是这样的效果。 如果想返回原来的颜色设置可以使用以下的命令: echo "^[[0;37;40m" 现在体会到这些神奇字符(转移序列)的作用了吗?然而这些奇怪的字符是不是很难理解呢?并且有时相同的转义序列在不同的终端上会有不同的显示结果。因此,UNIX的设计者发明了一种叫做 termcap的机制。 termcap是一个列出特定终端的所有功能的文本文件,并且给出了实现对应功能的转义序列。然而在这种机制发明后的几年中,逐渐被terminfo机制取代。程序员使用terminfo时不用花过多的时间查阅termcap。只需让程序查询terminfo的数据库就可得到控制字符,并将其发送到终端或终端仿真程序。 1.1 NCURSES是什么? 你可能会疑惑,引入的这些技术术语是什么。假设在使用termcap或者terminfo的情况下,每个应用程序都在访问terminfo数据库并且做一些必要的处理(比如发送控制字符等等)。不久这些操作的复杂度将会变得难以控制。于是,curses诞生了。curses 的命名是来自一个叫做 “cursor optimization”(光标最优化)的双关语(译者注:curses本身有诅咒的意思)。curses构成了一个工作在底层终端代码之上的封装,并向用户提供了一个灵活高效的API(Application Programming Interface 应用程序接口)。它提供了移动光标,建立窗口,产生颜色,处理鼠标操作等功能。使程序员编写应用程序不需要关心那些底层的终端操作。 那么ncurses又是什么?ncurses是最早的System V Release 4.0 (SVr4)中 CURSES的一个克隆。这是一个可自由配置的库,完全兼容旧版本的curses。简而言之,它是一个管理应用程序在字符终端显示的函数库。当后面提到curses的时候,同时也可以和NCURSES互换。 关于ncurses详细的更新历史可以查阅ncurses源代码分发包中的NEWS文件。Thomas Dickey是目前的维护人员。你可以通过bug-ncurses@gnu.org联系维护人员 1.2 我们可以用NCURSES做什么? ncurses不仅仅封装了底层终端功能,而且提供了一个相当稳固的工作框架(Framework)可以在字符模式下产生美观的界面。它提供了一些创建窗口的函数。而它的姊妹库 Menu、Panel和Form则对curses基础库及进行了扩展。这些扩展库通常都随同curses一起发行。我们可以建立一个同时包含多个窗口(multiple windows)、菜单(menus)、面板(panels)和表单(for
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值