ubuntu 14.04 安装压缩包版mysql
既有环境:
1)下载MySQL Community Server 5.6.17 压缩版(mysql-5.6.17-linux-glibc2.5-x86_64.tar.gz)
2)安装目录: /opt/library/mysql-5.6.17-linux-glibc2.5-x86_64
3)软链接为/opt/library/mysql,指向同目录下的mysql-5.6.17-linux-glibc2.5-x86_64
1. 创建mysql专有的用户和组
$ sudo groupadd mysql
$ sudo useradd -r -g mysql mysql
2. 修改mysql文件夹及软链接的owner
$ sudo chown -R mysql:mysql mysql-5.6.17-linux-glibc2.5-x86_64/
$ sudo chown -R mysql:mysql mysql
3. 使用mysql_install_db初始化授权表。此操作只是在MySQL初次安装时才需要执行,如果是已存在的安装,则可以跳过此步骤,否则会覆盖先前的授权信息。
$ sudo scripts/mysql_install_db --user=mysql
4. 发现mysql_install_db执行有错误。看错误提示,原来是因为缺少共享库libaio1。
xuyuzhu@xuyuzhu-OptiPlex-990:/opt/library/mysql$ sudo scripts/mysql_install_db --user=mysql
Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
5. 安装libaio1
$ sudo apt-get install libaio1
6. 重新执行第三步,以下是几行关键log
Installing MySQL system tables...2014-05-15 14:43:47 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). .
.
创建第一张数据表、表大小、buffer、fk、log文件
.
Filling help tables...2014-05-15 14:43:52 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). .
.
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 xuyuzhu-OptiPlex-990 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 .
.
总结下:
1)support-files/mysql.server用于启动mysql
2)可用 mysqladmin 或 mysql_secure_installation 命令修改密码
3)可以使用"cd . ; ./bin/mysqld_safe &"配置mysql守护进程
7. 添加mysql启动脚本软链接
$ cd /etc/init.d/
$ sudo ln -s /opt/library/mysql/support-files/mysql.server
8. 启动mysql服务
xuyuzhu@xuyuzhu-OptiPlex-990:/etc/init.d$ ./mysql.server start
/etc/init.d/mysql.server: 1: /etc/init.d/mysql.server: my_print_defaults: not found
/etc/init.d/mysql.server: 276: cd: can't cd to /usr/local/mysql
Starting MySQL
* Couldn't find MySQL server (/usr/local/mysql/bin/mysqld_safe)
9. 报错。因为mysql.server里读取mysql的目录是/user/local/mysql,所以在/user/local/中创建一个,mysql的软链接到/opt/library/mysql。再执行第8步。
$ ln -s /opt/library/mysql /usr/local/mysql
$ sudo chown mysql:mysql /usr/local/mysql
$ sudo ./mysql.server start
# 上面必须使用sudo权限启动, 不然会报 . * The server quit without updating PID file (/usr/local/mysql/data/xuyuzhu-OptiPlex-990.pid).
Starting MySQL
10. ps检查进程
xuyuzhu@xuyuzhu-OptiPlex-990:/etc/init.d$ ps -aux |grep mysql
root 373 0.0 0.0 4444 744 pts/13 S 15:16 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/xuyuzhu-OptiPlex-990.pid
mysql 484 2.4 11.4 976004 448164 pts/13 Sl 15:16 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/xuyuzhu-OptiPlex-990.err --pid-file=/usr/local/mysql/data/xuyuzhu-OptiPlex-990.pid
xuyuzhu 511 0.0 0.0 15960 916 pts/13 S+ 15:16 0:00 grep --color=auto mysql
11. mysqladmin检查是否可以使用mysql
$ mysqladmin version
mysqladmin Ver 8.42 Distrib 5.6.17, for linux-glibc2.5 on x86_64
Copyright (c) 2000, 2014, 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. Server version5.6.17
Protocol version10
ConnectionLocalhost via UNIX socket
UNIX socket/tmp/mysql.sock
Uptime:4 min 48 sec Threads: 1 Questions: 2 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables: 60 Queries per second avg: 0.006
12. 添加开机启动mysql服务守护进程
xuyuzhu@xuyuzhu-OptiPlex-990:/etc/init.d$ sudo update-rc.d mysql.server defaults
Adding system startup for /etc/init.d/mysql.server ...
/etc/rc0.d/K20mysql.server -> ../init.d/mysql.server
/etc/rc1.d/K20mysql.server -> ../init.d/mysql.server
/etc/rc6.d/K20mysql.server -> ../init.d/mysql.server
/etc/rc2.d/S20mysql.server -> ../init.d/mysql.server
/etc/rc3.d/S20mysql.server -> ../init.d/mysql.server
/etc/rc4.d/S20mysql.server -> ../init.d/mysql.server
/etc/rc5.d/S20mysql.server -> ../init.d/mysql.server
13. that’s all.
参考http://www.cnblogs.com/eastson/archive/2012/06/09/2543489.html
ps. Redhat启动mysql服务: /etc/init.d/mysqld start
ubuntu 14.04 安装压缩包版mysql的更多相关文章
- ubuntu 14.04安装nginx+php+mysql
前段时间的折腾,颇费一番周折,过程中发现网上的许多资料比较老旧过时了,所以在这里也简单把过程重新整理一遍,争取一帖解决问题. 基于最新的Ubuntu 14.04(2014年9月)搭建nginx.php ...
- U盘安装Ubuntu 14.04 LTS正式版
Ubuntu 14.04 LTS正式版发布,而且提供五年的支持和维护服务.Ubuntu 14.04是Ubuntu开发团队历经五年的心血之作.许多新手都喜欢把Linux安装文件刻录成光盘再安装,而安装好 ...
- 在Ubuntu 14.04安装和使用Docker
Docker是一个开源软件,它可以把一个Linux应用和它所依赖的一切(比如配置文件)都封装到一个容器.然而,Docker与虚拟机不同,它使用了沙箱机制,Docker容器不运行操作系统,它共享主机上的 ...
- [转]在Ubuntu 14.04安装和使用Docker
在Ubuntu 14.04安装和使用Docker 作者:chszs,版权所有,未经同意,不得转载.博主主页:http://blog.csdn.net/chszs Docker是一个开源软件,它可以把一 ...
- ubuntu 14.04安装 DevStack的脚本配置文件——localrc
本文ubuntu 14.04安装 DevStack的脚本配置文件——localrc,本文件名已经逐渐被取代,但是出于后向兼容性,使用该文件仍然可以为stack.sh安装脚本指定安装DevStack时的 ...
- Ubuntu 14.04 安装VMware 12
/*********************************************************************** * Ubuntu 14.04 安装VMware 12 ...
- Ubuntu 14.04安装Chromium浏览器并添加Flash插件Pepper Flas
转自Ubuntu 14.04安装Chromium浏览器并添加Flash插件Pepper Flash Player Chromium谷歌的开源浏览器将不再支持Netscape浏览器插件API,Adobe ...
- ubuntu 14.04 安装搜狗拼音输入法
原文:ubuntu 14.04 安装搜狗拼音输入法 ubuntu桌面系统下终于有了好用的拼音法-搜狗拼音输入法,欲在ubuntu 14.04下安装搜狗拼音输入法相当的简单. 先到搜狗拼音官网下载对应的 ...
- ubuntu 14.04 安装torch及编译环境zbstudio
ubuntu 14.04 安装torch及编译环境zbstudio torch zbstudio 本来是安装官网给的步骤安装torch的,可是碰到一系列的问题,后来参考网上的安装方法安装成功了 官网安 ...
随机推荐
- CSS3 Media Query 响应式媒体查询
在CSS中,有一个极其实用的功能:@media 响应式布局.具体来说,就是可以根据客户端的介质和屏幕大小,提供不同的样式表或者只展示样式表中的一部分.通过响应式布局,可以达到只使用单一文件提供多平台的 ...
- OneDrive网页版打不开的解决办法
发现OneDrive文件被误删了,想去网页版找回历史文件,发现网页版无法打开,而客户端是可以正常使用的,于是猜测是域名指向的主IP被封了,于是想通过客户端的IP访问 第一步,WireShark抓包 第 ...
- Win 10 +python3.5 之sklearn 的安装
一.文件下载 1.sklearn 需要在 numpy+mkl 安装之后和scipy 安装之后才可以安装. 2.scipy 在numpy+mkl安装之后才可以安装. 因此,三个软件的安装顺序是:num ...
- [qt][问题记录] 无法定位程序输入点 _ZdaPvj 于动态链接库 libstdc++-6.dll
无法定位程序输入点 _ZdaPvj 于动态链接库 libstdc++-6.dll 该问题是没有打包库的问题,之所以出现这个问题的是直接用系统自带的命令行使用qt的windeployqt命令导致提供的库 ...
- gcc编译 汇编 选项
gcc生成main.out的步骤分解:<blockquote>main.c-----(-S 编译)-------->main.s-------(-c 汇编)------->ma ...
- 分布式缓存之memcached--命令测试
1. 启动Memcache常用参数 -p <num> 设置TCP端口号(默认设置为: ) -U <num> UDP监听端口(默认: , 时关闭) -l <ip_addr& ...
- DbEntry 简单实现
在着手编码之前首先安装DbEntry DbEntry.Net.4.1.Setup.zip 在建立类库时选择 DbEntryClassLibrary 如图 DbEntryClassLibrary1 中建 ...
- NSArray倒序输出的方法
NSMutableArray *array = [NSMutableArray arrayWithObjects:",nil]; NSArray* reversedArray = [[arr ...
- css关系选择符
<!Doctype html> <html> <head> <meta http-equiv="Content-Type" content ...
- Spring AOP声明式事务异常回滚
近日测试用例,发现这样一个现象:在业务代码中,有如下两种情况,比如:throw new RuntimeException("xxxxxxxxxxxx"); 事物回滚throw ne ...