mysql安装for linux(二进制)
来源:互联网 发布:台湾ptt大陆网络用语 编辑:程序博客网 时间:2024/04/27 21:21
1、下载
下载页面是 http://dev.mysql.com/downloads/mysql/
http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.21-linux-glibc2.5-x86_64.tar.gz
如果出现新的版本,直接更改这个链接中的版本号即可,如现在应改为
http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz
2、复制到linux中,并解压
tar xvf mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz -C /usr/local
[root@zw oradata]# mv /usr/local/mysql-5.6.23-linux-glibc2.5-x86_64/ mysql
3、创建Mysql的用户和组
[root@zw oradata]# mv /usr/local/mysql-5.6.23-linux-glibc2.5-x86_64/ mysql
3、创建Mysql的用户和组
[root@zw oradata]# groupadd dba
[root@zw oradata]# useradd -r -g dba mysql
userdel -r test 删除test用户
userdel -r test 删除test用户
4 # 修改目录权限,指定给 mysql用户和用户组
[root@zw oradata]# chown -R mysql:dba /usr/local/mysql/
5.设置环境变量
export PATH=/usr/local/mysql/bin:$PATH
6、安装DB 初始化命令只能在 mysql 这个目录下执行,不然会报错
[root@zw oradata]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/
[root@zw oradata]# cp my.cnf /etc
7.修改配置文件
[root@zw oradata]# cp my.cnf /etc/my.cnf
/usr/local/mysql
[root@zw oradata]# vi /etc/my.cnf
[mysqld]中添加:
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
server_id = 1
/usr/local/mysql
[root@zw oradata]# vi /etc/my.cnf
[mysqld]中添加:
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
server_id = 1
log-bin=mysql-bin
8 :启动mySQL服务,
/usr/local/mysql/bin/mysqld_safe --user=root&
9、连接mysql
#使用MySQL命令的全路径。
[root@zw oradata]# /usr/local/mysql/bin/mysql -u root -p
Enter password:上面设置的password
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.5.40-log MySQL Community Server (GPL)
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.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
10.设置root密码
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.5.40-log MySQL Community Server (GPL)
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.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
10.设置root密码
./bin/mysqladmin -u root password 123
10、启动、关闭mysql
[root@zw oradata]#/usr/local/mysql/support-files/mysql.server start
[root@zw oradata]#/usr/local/mysql/support-files/mysql.server stop
如果想执行 service mysql start or restart stop 命令咋办的? 在不能老#./mysql.server start
解决方法: 将 mysql.server 复制一份到 /etc/rc.d/init.d 下并改名 mysql 或建个连接文件
假设当前目录为 /etc/rc.d/init.d
解决方法: 将 mysql.server 复制一份到 /etc/rc.d/init.d 下并改名 mysql 或建个连接文件
假设当前目录为 /etc/rc.d/init.d
[root@zw oradata]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
启动:
① service mysql start 前提是执行了cp support-files/mysql.server /etc/init.d/mysql
② ./etc/init.d/mysql start
③ ./usr/local/mysql/bin/mysqld_safe --user=root&
④ /usr/local/mysql/support-files/mysql.server start
关闭:
①. service mysql stop
②./etc/init.d/mysql stop
③./usr/local/mysql/bin/mysqladmin -u root -p shutdown
④./usr/local/mysql/support-files/mysql.server stop
11、设置开机启动项
[root@zw oradata]# cp support-files/mysql.server /etc/init.d/mysql 上面已经做了可以省略
[root@zw oradata]# chkconfig --add mysql
2 0
- mysql安装for linux(二进制)
- mysql安装for linux(二进制)
- mysql 5.7 binary 二进制版本安装 for linux 7
- linux mysql 二进制安装总结
- linux-mysql二进制安装调试
- Linux下MySQL二进制安装
- Linux Mysql 二进制包安装
- 在Linux中以命令行方式安装 MySQL 5.7.11 for Linux Generic 二进制版本
- Linux下安装Mysql--二进制安装
- linux/unix安装mysql 二进制包安装
- 在linux中二进制mysql的安装
- 在Linux上安装二进制源码MySQL
- 在linux里安装mysql(二进制)
- linux下mysql二进制方式安装
- linux 二进制 安装mysql 5.5.46
- mysql 5.7.16 linux二进制安装
- linux下mysql二进制包安装
- LINUX下MySQL 5.6.26 二进制安装
- Linux 应用程序超过10秒未调度
- Reverse Linked List
- 第一篇博客
- 第14周 【项目1 - 小玩文件】(4)
- 从DirectX SDK升级到Windows SDK
- mysql安装for linux(二进制)
- html5 实现画虚线
- IOS代码实现常用控件UIButton、UISlider、UISwitch、UISegmentedControl
- C++ Socket服务器简单代码示例
- linux php之脚本加速模块zend opcache
- 求1+2+3+...+n
- Android多线程编程详解,关于Handler ,Looper , Message , MessageQueue
- Groovy&Java multi Map 的引用
- oracle分页查询语句