MySQL在linux上的安装
来源:互联网 发布:淘宝的手机能买吗 编辑:程序博客网 时间:2024/06/05 14:34
下载MySQL二进制分发版本tar包
需要安装libaio的库
shell> yum search libaio # search for infoshell> yum install libaio # install library
shell> apt-cache search libaio # search for infoshell> apt-get install libaio1 # install library
确保机器上存在libaio的库
我是在MacOSX上面安装的mysql。
先把mysqld的命令加入到PATH目录
mysql分发包的目录结果如下
.//bin.//COPYING.//data.//docs.//include.//lib.//man.//my.cnf.//mysql-test.//README.//share.//support-files
PATH=$PATH:/Users/chenrenyuan/program/mysql/bin/
先做好命令行参数的个性化配置,本人配置如下
nohup mysqld --initialize --user=chenrenyuan --basedir=/Users/chenrenyuan/program/mysql/ --datadir=/Users/chenrenyuan/program/mysql/data --plugin-dir=/Users/chenrenyuan/program/mysql/plugin --character-set-server=utf8 --general-log-file=/Users/chenrenyuan/program/mysql/general-log.file &
这里需要关注的是初始化的命令参数
然后会输出
chenrenyuan-MacBookPro:mysql chenrenyuan$ bash install.sh 2017-07-14T02:51:19.586472Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2017-07-14T02:51:19.588413Z 0 [Warning] Setting lower_case_table_names=2 because file system for /Users/chenrenyuan/program/mysql/data/ is case insensitive2017-07-14T02:51:19.732025Z 0 [Warning] InnoDB: New log files created, LSN=457902017-07-14T02:51:19.752084Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.2017-07-14T02:51:19.807617Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 50552860-683f-11e7-a608-245a56a32efc.2017-07-14T02:51:19.827411Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2017-07-14T02:51:19.829059Z 1 [Note] A temporary password is generated for root@localhost: gIMndkX:N1po
主要要关注一个地方是会生成一个root的密码,需要用到这个初始化密码去改root密码
2017-07-14T02:51:19.829059Z 1 [Note] A temporary password is generated for root@localhost: gIMndkX:N1po
然后进入到mysql的目录下的support-files目录,里面有mysql服务器的启动脚本mysql.server,但是里面的basedir跟datadir要修改成与你在命令参数启动一致的文件名
启动
chenrenyuan-MacBookPro:support-files chenrenyuan$ bash mysql.server startStarting MySQL. SUCCESS! chenrenyuan-MacBookPro:support-files chenrenyuan$
然后使用 进入修改密码,不修改密码前进行操作会报错
mysql -u root -h localhost -p
mysql> show tables;ERROR 1046 (3D000): No database selectedmysql> use mysql;ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql>
修改密码
set password for root@localhost = password('root');
退出重新登录使用修改密码即可
配置文件配置utf8编码配置demo
[mysqld]character-set-server=utf8collation-server=utf8_general_ci[mysql]default-character-set=utf8[mysql.server]default-character-set=utf8[mysqld_safe]default-character-set=utf8[client]default-character-set=utf8
阅读全文
0 0
- mysql在linux上的绿色安装
- MySQL在linux上的安装
- 在linux上安装mysql
- 在linux上安装mysql
- 在linux上安装mysql
- 在linux上安装mysql
- 在linux上安装mysql
- 在Linux的Eclipse上安装配置MySQL+MySQL++
- 在Linux上,使用MySQL的yum仓库,安装MySQL
- mysql在linux上的安装之一yum安装
- mysql在linux上的安装之三(二进制安装)
- 在linux上MySQL的三种安装方式
- Linux上mysql的安装
- 在Linux(RHEL4)上安装MySQL
- 在linux上用源代码安装mysql
- 在Linux上安装MySQL 5.0
- 在Linux上安装二进制源码MySQL
- 在Linux CentOS上安装mysql
- 基于 CentOS 搭建 FTP 文件服务
- 【c#】类的定义---各关键字的作用
- mybatis mysql 批量insert 返回主键
- 创始人不得不学的团队建设法则
- 数据结构基础二-----之模块一《线性存储【数组】》
- MySQL在linux上的安装
- 【c#】类类型和结构类型的区别
- 目录树 数据结构设计
- SVN概述
- 携程第四代架构探秘之运维基础架构升级
- Python,Jupyter Notebook,IPython快速安装教程
- 【c#】定义类成员(字段、方法、属性)
- Hanoi Tower 汉诺塔的简单分析/C
- 在properties文件中链接Mysql和Orcal的方法