您当前的位置:首页 > 电脑百科 > 数据库 > MYSQL

Mysql6.5二进制安装

时间:2020-07-02 15:26:28  来源:  作者:
操作系统
Oracle linux Server release 6.3
数据库
MySQL5.6
#添加mysql用户和组
[root@localhost App]# groupadd mysql
[root@localhost app]# useradd -g mysql mysql
[root@localhost app]#tar zxvf mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz
[root@localhost app]# ls
mysql-5.6.12-linux-glibc2.5-x86_64 oracle
mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz
[root@localhost app]# mv mysql-5.6.12-linux-glibc2.5-x86_64 mysql
[root@localhost app]# chown mysql:mysql mysql
[root@localhost app]# pwd
/app
[root@localhost app]# cd mysql
#初始化mysql库
[root@localhost mysql]# scripts/mysql_install_db --user=mysql --basedir=/app/mysql --datadir=/mydata/
Installing MySQL system tables...2015-05-01 18:31:07 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-05-01 18:31:07 7432 [Note] InnoDB: The InnoDB memory heap is disabled
2015-05-01 18:31:07 7432 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-05-01 18:31:07 7432 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-05-01 18:31:07 7432 [Note] InnoDB: Using Linux native AIO
2015-05-01 18:31:07 7432 [Note] InnoDB: Using CPU crc32 instructions
2015-05-01 18:31:07 7432 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-05-01 18:31:07 7432 [Note] InnoDB: Completed initialization of buffer pool
2015-05-01 18:31:07 7432 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2015-05-01 18:31:07 7432 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2015-05-01 18:31:07 7432 [Note] InnoDB: Database physically writes the file full: wait...
2015-05-01 18:31:08 7432 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2015-05-01 18:31:08 7432 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2015-05-01 18:31:10 7432 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2015-05-01 18:31:10 7432 [Warning] InnoDB: New log files created, LSN=45781
2015-05-01 18:31:10 7432 [Note] InnoDB: Doublewrite buffer not found: creating new
2015-05-01 18:31:10 7432 [Note] InnoDB: Doublewrite buffer created
2015-05-01 18:31:10 7432 [Note] InnoDB: 128 rollback segment(s) are active.
2015-05-01 18:31:10 7432 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-05-01 18:31:10 7432 [Note] InnoDB: Foreign key constraint system tables created
2015-05-01 18:31:10 7432 [Note] InnoDB: Creating tablespace and datafile system tables.
2015-05-01 18:31:10 7432 [Note] InnoDB: Tablespace and datafile system tables created.
2015-05-01 18:31:10 7432 [Note] InnoDB: Waiting for purge to start
2015-05-01 18:31:10 7432 [Note] InnoDB: 5.6.12 started; log sequence number 0
2015-05-01 18:31:11 7432 [Note] Binlog end
2015-05-01 18:31:11 7432 [Note] InnoDB: FTS optimize thread exiting.
2015-05-01 18:31:11 7432 [Note] InnoDB: Starting shutdown...
2015-05-01 18:31:12 7432 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK
Filling help tables...2015-05-01 18:31:12 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-05-01 18:31:12 7455 [Note] InnoDB: The InnoDB memory heap is disabled
2015-05-01 18:31:12 7455 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-05-01 18:31:12 7455 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-05-01 18:31:12 7455 [Note] InnoDB: Using Linux native AIO
2015-05-01 18:31:12 7455 [Note] InnoDB: Using CPU crc32 instructions
2015-05-01 18:31:12 7455 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-05-01 18:31:12 7455 [Note] InnoDB: Completed initialization of buffer pool
2015-05-01 18:31:12 7455 [Note] InnoDB: Highest supported file format is Barracuda.
2015-05-01 18:31:12 7455 [Note] InnoDB: 128 rollback segment(s) are active.
2015-05-01 18:31:12 7455 [Note] InnoDB: Waiting for purge to start
2015-05-01 18:31:12 7455 [Note] InnoDB: 5.6.12 started; log sequence number 1625977
2015-05-01 18:31:12 7455 [Note] Binlog end
2015-05-01 18:31:12 7455 [Note] InnoDB: FTS optimize thread exiting.
2015-05-01 18:31:12 7455 [Note] InnoDB: Starting shutdown...
2015-05-01 18:31:14 7455 [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:
/app/mysql/bin/mysqladmin -u root password 'new-password'
/app/mysql/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
Alternatively you can run:
/app/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 . ; /app/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 /app/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
#把开机脚本传到etc目录下面
[root@localhost mysql]# cp support-files/mysql.server /etc/init.d/mysqld
cp: overwrite `/etc/init.d/mysqld'? y
#添加数据文件和mysql家目录
[root@localhost mysql]# vi /etc/init.d/mysqld
1 #!/bin/sh
2 # Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detro n HB
3 # This file is public domain and comes with NO WARRANTY of any kind
4
5 # MySQL daemon start/stop script.
6
7 # Usually this is put in /etc/init.d (at least on machines SYSV R4 based
8 # systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
9 # When this is done the mysql server will be started when the machine is
10 # started and shut down when the systems goes down.
11
12 # Comments to support chkconfig on RedHat Linux
13 # chkconfig: 2345 64 36
14 # description: A very fast and reliable SQL database engine.
15
16 # Comments to support LSB init script conventions
17 ### BEGIN INIT INFO
18 # Provides: mysql
19 # Required-Start: $local_fs $network $remote_fs
20 # Should-Start: ypbind nscd ldap ntpd xntpd
21 # Required-Stop: $local_fs $network $remote_fs
22 # Default-Start: 2 3 4 5
23 # Default-Stop: 0 1 6
24 # Short-Description: start and stop MySQL
25 # Description: MySQL is a very fast and reliable SQL database engine.
26 ### END INIT INFO
27
28 # If you install MySQL on some other places than /usr/local/mysql, then you
29 # have to do one of the following things for this script to work:
30 #
31 # - Run this script from within the MySQL installation directory
32 # - Create a /etc/my.cnf file with the following information:
33 # [mysqld]
34 # basedir=<path-to-mysql-installation-directory>
35 # - Add the above to any other configuration file (for example ~/.my.ini )
36 # and copy my_print_defaults to /usr/bin
37 # - Add the path to the mysql-installation-directory to the basedir vari able
38 # below.
39 #
40 # If you want to affect other MySQL variables, you should make your chan ges
41 # in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
42
43 # If you change base dir, you must also change datadir. These may get
44 # overwritten by settings in the MySQL configuration files.
45
46 basedir=/app/mysql
47 datadir=/mydata
48
49 # Default value, in seconds, afterwhich the script should timeout waitin g
50 # for server start.
51 # Value here is overriden by value in my.cnf.
52 # 0 means don't wait at all
53 # Negative numbers mean to wait indefinitely
54 service_startup_timeout=900
55
56 # Lock directory for RedHat / SuSE.
57 lockdir='/var/lock/subsys'
58 lock_file_path="$lockdir/mysql"
59
60 # The following variables are only set for letting mysql.server find thi ngs.
61
"/etc/rc.d/init.d/mysqld" 390L, 10897C written
#拷贝参数文件到、etc目录
[root@localhost mysql]# cp my.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf'? y
[root@localhost mysql]# vi /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
basedir =/app/mysql
datadir =/mydata
port =3306
server_id =1
socket=/var/lib/mysql/mysql.sock
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
~
"/etc/my.cnf" 28L, 937C written
#添加开机启动服务
[root@localhost mysql]# chkconfig --add mysqld
[root@localhost mysql]# chkconfig --level 2345 mysqld off
[root@localhost mysql]# su - mysql
#重启mysql
[root@localhost mysql]# service mysqld restart
MySQL server PID file could not be found! [FAILED]
Starting MySQL.. [ OK ]
#修改root密码
[root@localhost mysql]# bin/mysqladmin -u root password 'mysql'
-bash-4.1$ mysql -uroot -pmysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.6.12 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, 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>


Tags:Mysql6.5   点击:()  评论:()
声明:本站部分内容及图片来自互联网,转载是出于传递更多信息之目的,内容观点仅代表作者本人,如有任何标注错误或版权侵犯请与我们联系(Email:2595517585@qq.com),我们将及时更正、删除,谢谢。
▌相关推荐
操作系统 Oracle Linux Server release 6.3 数据库 Mysql5.6 #添加mysql用户和组 [root@localhost app]# groupadd mysql [root@localhost app]# useradd -g mysql mysql [r...【详细内容】
2020-07-02  Tags: Mysql6.5  点击:(197)  评论:(0)  加入收藏
▌简易百科推荐
作者:雷文霆 爱可生华东交付服务部 DBA 成员,主要负责Mysql故障处理及相关技术支持。爱好看书,电影。座右铭,每一个不曾起舞的日子,都是对生命的辜负。 本文来源:原创投稿 *爱可生...【详细内容】
2021-12-24  爱可生    Tags:MySQL   点击:(7)  评论:(0)  加入收藏
生成间隙(gap)锁、临键(next-key)锁的前提条件 是在 RR 隔离级别下。有关Mysql记录锁、间隙(gap)锁、临键锁(next-key)锁的一些理论知识之前有写过,详细内容可以看这篇文章...【详细内容】
2021-12-14  python数据分析    Tags:MySQL记录锁   点击:(18)  评论:(0)  加入收藏
binlog 基本认识 MySQL的二进制日志可以说是MySQL最重要的日志了,它记录了所有的DDL和DML(除了数据查询语句)语句,以事件形式记录,还包含语句所执行的消耗的时间,MySQL的二...【详细内容】
2021-12-14  linux上的码农    Tags:mysql   点击:(13)  评论:(0)  加入收藏
为查询优化你的查询 大多数的MySQL服务器都开启了查询缓存。这是提高性最有效的方法之一,而且这是被MySQL的数据库引擎处理的。当有很多相同的查询被执行了多次的时候,这些查...【详细内容】
2021-12-09  元宇宙iwemeta    Tags:mysql   点击:(15)  评论:(0)  加入收藏
测试的目的和原因,公司有很多程序员,每个程序员对数据库和表结构都有自己的理解。而且每个程序员的理解往往是以效率考虑。既然都是为了效率考虑,那么我就来测试一下究竟哪种使...【详细内容】
2021-12-08  吴彬的分享    Tags:Mysql数据库   点击:(14)  评论:(0)  加入收藏
当你们考虑项目并发的时候,我在部署环境,当你们在纠结使用ArrayList还是LinkedArrayList的时候,我还是在部署环境。所以啊,技术不止境,我在部环境。今天这篇文章缕一下在同一台服...【详细内容】
2021-12-08  秃头码哥    Tags:MySQL数据库   点击:(17)  评论:(0)  加入收藏
对于数据分析来说,MySQL使用最多的是查询,比如对数据进行排序、分组、去重、汇总及字符串匹配等,如果查询的数据涉及多个表,还需要要对表进行连接,本文就来说说MySQL中常用的查询...【详细内容】
2021-12-06  笨鸟学数据分析    Tags:MySQL   点击:(21)  评论:(0)  加入收藏
在学习SQL语句之前,首先需要区分几个概念,我们常说的数据库是指数据库软件,例如MySQL、Oracle、SQL Server等,而本文提到的数据库是指数据库软件中的一个个用于存储数据的容器。...【详细内容】
2021-11-24  笨鸟学数据分析    Tags:SQL语句   点击:(23)  评论:(0)  加入收藏
概述以前参加过一个库存系统,由于其业务复杂性,搞了很多个应用来支撑。这样的话一份库存数据就有可能同时有多个应用来修改库存数据。比如说,有定时任务域xx.cron,和SystemA域...【详细内容】
2021-11-05  Java云海    Tags:分布式锁   点击:(31)  评论:(0)  加入收藏
MySQL的进阶查询 一、 按关键字排序 使用ORDERBY语句来实现排序排序可针对一个或多个字段ASC:升序,默认排序方式 【升序是从小到大】DESC:降序 【降序是从大到小】ORDER BY的...【详细内容】
2021-11-05  Java热点    Tags:SQL语句   点击:(28)  评论:(0)  加入收藏
相关文章
    无相关信息
最新更新
栏目热门
栏目头条