Chinaunix首页 | 论坛 | 博客
  • 博客访问: 350606
  • 博文数量: 166
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1640
  • 用 户 组: 普通用户
  • 注册时间: 2015-05-05 11:44
个人简介

文章不在长,坚持不懈记录下努力前行的脚步

文章分类

全部博文(166)

文章存档

2017年(19)

2016年(59)

2015年(88)

我的朋友

分类: Mysql/postgreSQL

2015-09-28 18:02:34

Oracle提供了一系列的MySQL二进制安装包,文件为以tar.gz为后缀的压缩包,不同平台可以选择不同的包,可以通过文件名来识别适合特定平台的安装包,压缩包的命名方式形如:mysql-VERSION-OS.tar.gz
例:mysql-5.6.25-linux-glibc2.5-x86_64.tar.gz
警告
1.如果你在本地已经通过包管理系统比如yum或apt安装了MySQl,那么你用二进制安装的话可能会遇到问题。安装前一定要确保当前安装的MySQL已经完整的移出(用包管理系统),还有附带的文件,比如数据文件,配置文件也必须删除
2.MySQL has a dependency on the libaio library,Data directory initialization and subsequent server startup steps will fail if this library is not installed locally. If necessary, install it using the appropriate package manager. For example, on Yum-based systems:
shell> yum search libaio  # search for info
shell> yum install libaio # install library

Or, on APT-based systems:
shell> apt-cache search libaio # search for info
shell> apt-get install libaio1 # install library
在类Unix平台上,选择一个路径解压安装包,一般是/usr/local/mysql.

安装步骤
shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
========================================================
Installing MySQL system tables...
150929 15:11:23 [Note] ./bin/mysqld (mysqld 5.5.44) starting as process 27268 ...
OK
Filling help tables...
150929 15:11:23 [Note] ./bin/mysqld (mysqld 5.5.44) starting as process 27275 ...
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 iZ254ppumyrZ 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 at />
========================================================
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server
启动mysql的时候报了一个错
 /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)
到指定目录下去查看该目录不存在,于是将my.cnf中pid-file注掉,重启即可
由于mysql没有添加到服务,所以通过命令service mysqld status查看mysql运行状况是会报不能识别服务的错误,通常的做法是ps -ef|grep mysqld
登录是加上socket文件
























阅读(773) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~