Linux下安装mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz
作者:mrr 发布时间:2024-01-27 20:07:57
标签:mysql,5.6.12,tar.gz
从官网下载mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz
创建mysql用户
[root@Master home]# useradd mysql
[root@Master data]# echo 'mysql'|passwd --stdin mysql
更改用户 mysql 的密码 。
passwd: 所有的身份验证令牌已经成功更新。
创建mysql用户的原因
不用mysql用户会出现一下错误,尝试了很多次,添加mysql用户安装成功
*当然很多时候我们已经创建好别的用户,来完成日常的操作如果不创建mysql用户,修改mysql/bin目录下的mysqld_safe文件; //亲测成功
具体步骤:
[root@Master bin]# vim mysqld_safe
user='mysql' 修改为 user='hadoop' //自己的用户 后边步骤基本相同*
[root@Slave1 data]# service mysql start
Starting MySQL...... ERROR! The server quit without updating PID file (/home/hadoop/ruanJian/mysql/data/Slave1.Hadoop.pid).
[root@Master data]#vim Slave1.Hadoop.err //查看日志文件
160830 15:56:44 mysqld_safe Starting mysqld daemon with databases from /home/hadoop/ruanJian/mysql/data
2016-08-30 15:56:49 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-08-30 15:56:49 1990 [ERROR] Fatal error: Can't change to run as user 'mysql' ; Please check that the user exists!
2016-08-30 15:56:49 1990 [ERROR] Aborting
2016-08-30 15:56:49 1990 [Note] Binlog end
2016-08-30 15:56:49 1990 [Note] /home/hadoop/ruanJian/mysql/bin/mysqld: Shutdown complete
160830 15:56:49 mysqld_safe mysqld from pid file /home/hadoop/ruanJian/mysql/data/Slave1.Hadoop.pid ended
在mysql用户下创建data目录并解压
[root@Master data]# tar -zxvf mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz
[root@Master data]# mv mysql-5.6.12-linux-glibc2.5-x86_64 mysql //重命名
设置权限
[root@Master data]# chown -R mysql:mysql mysql
切换用户并进入mysql/scripts 目录
[root@Master data]# su mysql
[mysql@Master data]$ cd mysql/scripts/
[mysql@Master scripts]$
安装(目录根据自己的mysql解压目录自行设置)
[mysql@Master scripts]$ ./mysql_install_db --user=mysql --basedir=/home/mysql/data/mysql --datadir=/home/mysql/data/mysql/data
输出信息
Installing MySQL system tables...2016-08-30 19:55:41 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-08-30 19:55:42 1354 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)
2016-08-30 19:55:42 1354 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000)
2016-08-30 19:55:42 1354 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-30 19:55:42 1354 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-30 19:55:42 1354 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-08-30 19:55:42 1354 [Note] InnoDB: Using Linux native AIO
2016-08-30 19:55:42 1354 [Note] InnoDB: Not using CPU crc32 instructions
2016-08-30 19:55:42 1354 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-30 19:55:42 1354 [Note] InnoDB: Completed initialization of buffer pool
2016-08-30 19:55:42 1354 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2016-08-30 19:55:42 1354 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2016-08-30 19:55:42 1354 [Note] InnoDB: Database physically writes the file full: wait...
2016-08-30 19:55:42 1354 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2016-08-30 19:55:43 1354 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2016-08-30 19:55:44 1354 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2016-08-30 19:55:44 1354 [Warning] InnoDB: New log files created, LSN=45781
2016-08-30 19:55:44 1354 [Note] InnoDB: Doublewrite buffer not found: creating new
2016-08-30 19:55:44 1354 [Note] InnoDB: Doublewrite buffer created
2016-08-30 19:55:44 1354 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-30 19:55:44 1354 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-08-30 19:55:44 1354 [Note] InnoDB: Foreign key constraint system tables created
2016-08-30 19:55:44 1354 [Note] InnoDB: Creating tablespace and datafile system tables.
2016-08-30 19:55:44 1354 [Note] InnoDB: Tablespace and datafile system tables created.
2016-08-30 19:55:44 1354 [Note] InnoDB: Waiting for purge to start
2016-08-30 19:55:44 1354 [Note] InnoDB: 5.6.12 started; log sequence number 0
2016-08-30 19:55:44 1354 [Note] Binlog end
2016-08-30 19:55:44 1354 [Note] InnoDB: FTS optimize thread exiting.
2016-08-30 19:55:44 1354 [Note] InnoDB: Starting shutdown...
2016-08-30 19:55:46 1354 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK
Filling help tables...2016-08-30 19:55:46 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-08-30 19:55:46 1377 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)
2016-08-30 19:55:46 1377 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000)
2016-08-30 19:55:46 1377 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-30 19:55:46 1377 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-30 19:55:46 1377 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-08-30 19:55:46 1377 [Note] InnoDB: Using Linux native AIO
2016-08-30 19:55:46 1377 [Note] InnoDB: Not using CPU crc32 instructions
2016-08-30 19:55:46 1377 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-30 19:55:46 1377 [Note] InnoDB: Completed initialization of buffer pool
2016-08-30 19:55:46 1377 [Note] InnoDB: Highest supported file format is Barracuda.
2016-08-30 19:55:46 1377 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-30 19:55:46 1377 [Note] InnoDB: Waiting for purge to start
2016-08-30 19:55:46 1377 [Note] InnoDB: 5.6.12 started; log sequence number 1625977
2016-08-30 19:55:46 1377 [Note] Binlog end
2016-08-30 19:55:46 1377 [Note] InnoDB: FTS optimize thread exiting.
2016-08-30 19:55:46 1377 [Note] InnoDB: Starting shutdown...
2016-08-30 19:55:48 1377 [Note] InnoDB: Shutdown completed; log sequence number 1625987
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:
/home/mysql/data/mysql/bin/mysqladmin -u root password 'new-password'
/home/mysql/data/mysql/bin/mysqladmin -u root -h Master.Hadoop password 'new-password'
Alternatively you can run:
/home/mysql/data/mysql/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 . ; /home/mysql/data/mysql/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 with the ./bin/mysqlbug script!
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 /home/mysql/data/mysql/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server
配置文件
[mysql@Master scripts]$ cd ../support-files/
[root@Master support-files]# cp my-default.cnf /etc/my.cnf
[root@Master support-files]# cp mysql.server /etc/init.d/mysql
[root@Master support-files]# vim /etc/init.d/mysql //修改mysql文件
添加以下两行
basedir=/home/mysql/data/mysql
datadir=/home/mysql/data/mysql/data
配置环境变量
[root@Master support-files]# vim /etc/profile
#set mysql environment
export MYSQL_HOME=/home/mysql/data/mysql
export PATH=$MYSQL_HOME/bin:$PATH
配置mysql服务开机自动启动
[root@Master bin]# chkconfig --add mysql //添加mysql
[root@Master bin]# chkconfig mysql on //设置开机启动
启动mysql
[root@Master support-files]# service mysql start
env: /etc/init.d/mysql: 权限不够 //如果出现这个提示 执行以下命令重新启动
[root@Master support-files]# chmod a+wrx /etc/init.d/mysql
[root@Master support-files]# service mysql start
Starting MySQL.. SUCCESS! //启动成功
设置root登录密码
[root@Master ~]# cd /home/mysql/data/mysql/bin/ //进去mysql的bin目录
[root@Master bin]# ./mysqladmin -u root password 'password' //'password' 为自己设置的密码引号非必须
[root@Master bin]# ./mysqladmin -u root password mysql
[root@Master bin]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.12 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, 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>
以上所述是小编给大家介绍的Linux下安装mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz网站的支持!
0
投稿
猜你喜欢
- 目录前言解决方案工具介绍工作原理使用限制使用注意使用示例部分参数说明输出结果示例腾讯云数据库 MySQL 使用注意总结一下前言写作案例分析,
- 问题参考自:https://www.zhihu.com/question/440066129/answer/1685329456 ,mysq
- 把你想加密的文档的源代码拷贝到下面的文本框内,按下生成按钮就可以得到一段加密了的页面代码,把代码复制到新的页面就可以了. [注意:可重复加密
- 解决方案:1、在MY.INI文件中的 [mysqld] 中增加一行tmpdir="D:/MySQL/data/"修改后,
- django可以在运行服务器时指定端口号python manage.py runserver 8080我们启动django开发服务器,输入命
- 问题描述有时在遇到一个文本需要统计文本内词汇的次数 的时候 ,可以用一个简单的python程序来实现。解决方案首先需要的是一个文本文件(.t
- 先以mysql的语句,聚合用在分组里,对mysql中groupby 是分组每什么的时候就要分组,如 每个小组,就按小组分,group by
- Python基本输入和输出1.input输入函数input函数:获取用户输入,保存成一个字符串。>>> name = in
- 本文为大家分享了MySQL预编译功能,供大家参考,具体内容如下1、预编译的好处大家平时都使用过JDBC中的PreparedStatement
- 开发环境:Pycharm 2018.3 + Anaconda3(5.3.0) + Python 3.7.1 + Numpy 1.15.4在此
- 一、相同点dump 和 dumps 都实现了序列化load 和 loads 都实现反序列化变量从内存中变成可存储或传输的过程称之为序列化序列
- 一、定义字典是一系列的键-值对,键与值之间用冒号隔开,而键-值对之间用逗号隔开,其中的“键”和&am
- 本文实例为大家分享了python学生管理系统开发的具体代码,供大家参考,具体内容如下学生管理系统(基础版)#定义一个函数,显示可以使用的功能
- 实例如下所示:import osos.chdir("G:\Python1\Lib\site-packages\pytesser&q
- 利用python3来实现TCP协议,和UDP类似。UDP应用于及时通信,而TCP协议用来传送文件、命令等操作,因为这些数据不允许丢失,否则会
- 1、pyinstaller的使用网上资料多,此处省略2、打包时报错1、可能有些包没有安装(跑跑程序不缺库就行)2、有些包pyinstalle
- 参考 https://books.agiliq.com/projects/django-admin-cookbook/en/lat
- 在keras中,数据是以张量的形式表示的,不考虑动态特性,仅考虑shape的时候,可以把张量用类似矩阵的方式来理解。例如[[1],[2],[
- 引言做接口测试中,对于一般性的单业务接口测试很多工具可供选择,但是对于一些相关业务相关性的关联接口测试就比较麻烦,使用工具比如jmeter、
- # -*- coding: utf-8 -*- import httplibfrom urllib import urlencodeimpo