文档章节

Centos源码安装mysql

泡海椒
 泡海椒
发布于 2015/12/25 20:26
字数 786
阅读 35
收藏 1

  rz -y
  yum install gcc-c++
  [root@localhost cmake-2.8.8]# ./configure
[root@localhost cmake-2.8.8]#gmake
[root@localhost cmake-2.8.8]# gamke install
[root@localhost cmake-2.8.8]# echo $0
bash
[root@localhost cmake-2.8.8]# cd ..
[root@localhost soft]# yum install ncurses-devel -y
阿里云源
[localhost soft]# tar -xf mysql-5.5.32.tar.gz
st soft]# cd mysql-5.5.32
[root@localhost ~]# groupadd mysql
[root@localhost ~]# useradd mysql -s/sbin/nologin -M -g mysql


   cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.5.32 -DMYSQL_DATADIR=/application/mysql-5.5.32/data -DMYSQL_UNIX_ADDR=/application/mysql-5.5.32/tmp/mysql.sock -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1   -DEXTRA_CHARSETS=all -DMYSQL_TCP_PORT=3306

[root@localhost mysql-5.5.32]# make && make install
ln -s /application/mysql-5.5.32/ /application/mysql
[root@localhost mysql-5.5.32]# cd ..
[root@localhost soft]# ls
cmake-2.8.8         mysql-5.5.32
cmake-2.8.8.tar.gz  mysql-5.5.32.tar.gz

oot@localhost soft]# cp mysql-5.5.32/support-files/my-small.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf'? y
[root@localhost soft]# echo 'export PATH=/application/mysql/bin:$PATH' >>/etc/profile
tail -1 /etc/profile
source /etc/profile
[root@localhost soft]# echo $PATH
/application/mysql/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/root/bin
[root@localhost soft]# ll /application/mysql/data/
total 4
drwxr-xr-x. 2 root root 4096 Dec 25 03:19 test
[root@localhost soft]# chown -R mysql.mysql /application/mysql/data
[root@localhost soft]# chmod -R 1777 /tmp/
[root@localhost soft]# cd /application/mysql/scripts
[root@localhost scripts]# ./mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK

[root@localhost mysql]# cd ~/soft
[root@localhost mysql]# cd ~/soft
[root@localhost soft]# ls
cmake-2.8.8  cmake-2.8.8.tar.gz  mysql-5.5.32  mysql-5.5.32.tar.gz
[root@localhost soft]# cd mysql-5.5.32
[root@localhost mysql-5.5.32]# /bin/cp support-files/mysql.server /etc/init.d/mysqld
[root@localhost mysql-5.5.32]# chmod +x /etc/init.d/mysqld
[root@localhost mysql-5.5.32]# /etc/init.d/mysqld start
Starting MySQL.... SUCCESS!
[root@localhost mysql-5.5.32]#
[root@localhost mysql-5.5.32]# netstat -lntup|grep 3306
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      46593/mysqld        
[root@localhost mysql-5.5.32]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.32 Source distribution

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.
#额外授权管理员 grant all privileges on *.* to system@'localhost' identified by 'admin' with grant option
mysql>
mysql> select user,host from mysql.user;
+------+-----------------------+
| user | host                  |
+------+-----------------------+
| root | 127.0.0.1             |
| root | ::1                   |
|      | localhost             |
| root | localhost             |
|      | localhost.localdomain |
| root | localhost.localdomain |
+------+-----------------------+
6 rows in set (0.00 sec)
mysql> select user,host from mysql.user;
+------+-----------------------+
| user | host                  |
+------+-----------------------+
| root | 127.0.0.1             |
| root | ::1                   |
|      | localhost             |
| root | localhost             |
|      | localhost.localdomain |
| root | localhost.localdomain |
+------+-----------------------+
6 rows in set (0.00 sec)

mysql> delete from mysql.user where user='';
Query OK, 2 rows affected (0.00 sec)

mysql> select user,host from mysql.user;
+------+-----------------------+
| user | host                  |
+------+-----------------------+
| root | 127.0.0.1             |
| root | ::1                   |
| root | localhost             |
| root | localhost.localdomain |
+------+-----------------------+
4 rows in set (0.00 sec)

mysql> delete from mysql.user where host='::1';
Query OK, 1 row affected (0.00 sec)

mysql> select user,host from mysql.user;
+------+-----------------------+
| user | host                  |
+------+-----------------------+
| root | 127.0.0.1             |
| root | localhost             |
| root | localhost.localdomain |
+------+-----------------------+
3 rows in set (0.00 sec)

mysql> delete from mysql.user where host='localhost.localdomain';
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.05 sec)

mysql> drop test;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'test' at line 1
mysql> drop table test;
ERROR 1046 (3D000): No database selected
mysql> drop database test;
Query OK, 0 rows affected (0.01 sec)

mysql>  show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

mysql>
mysql> quit;
Bye
/application/mysql/bin/mysqladmin -u root password 'admin' #'new-password'
[root@localhost mysql-5.5.32]# vi /etc/sysconfig/i18n
#LANG="en_US.UTF-8"
#LANG="en_US.UTF-8"
LANG="zh_CN.UTF-8"
[root@localhost mysql-5.5.32]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.32 Source distribution

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>
[root@localhost mysql-5.5.32]# chkconfig mysqld on
[root@localhost mysql-5.5.32]# chkconfig --list mysqld
mysqld             0:off    1:off    2:on    3:on    4:on    5:on    6:off




© 著作权归作者所有

上一篇: ubantu安装java
下一篇: hadoop之hive
泡海椒
粉丝 11
博文 282
码字总数 288344
作品 0
成都
程序员
私信 提问
源码安装lamp

在实际环境中我们经常根据自己所处的公司环境进行配置,适合自己公司的配置。下面我们来介绍如何进行编译安装 安装前提 在CentOS7 系统: 关闭iptables 将selinux设置为disabled apr-1.6.2.ta...

Joah_Li
2017/10/18
0
0
玩转MySQL 8.0源码编译

导读 最近十年来又一次玩玩MySQL源码编译安装,挺D疼的。 这阵子结课了,闲来无事就继续折腾之前记录的一些TODO,其中一个是令人D疼的MySQL源码编译。 此前我最后一次编译MySQL源码大概10年前...

老叶茶馆
05/04
0
0
CentOS6编译安装 LAMP+Wordpress--搭建自己的博客

CentOS6安装LAMP+Wordpress--搭建自己的博客 背景: LAMP也就是Linux+Apache+Mysql(Mariadb)+PHP(Python...),这是个基本的网站架构,在学会了编译安装LAMP环境后,在加上Wordpress就可以...

657188918
2017/10/11
0
0
CentOS7 搭建nginx+php+mysql运行环境

在centOS上有两种方式可以安装nginx、php、mysql,即通过yum指令来安装;通过编译源 码安装。CentOS 7上系统自带有yum源,下介绍nginx通过源码及yum安装的方法及php、 mysql通过yum指令安装的...

niedongri
2017/11/21
0
0
centos7 mysql5.7.17源码安装

centos7 mysql5.7.17源码安装 **安装前准备 操作系统环境:Centos 7.2 1、解决依赖包并下载源码包至/home/soft/目录下 [root@node03 ~]# yum -y install gcc gcc-c++ ncurses ncurses-devel ...

yikayi
2017/02/10
0
0

没有更多内容

加载失败,请刷新页面

加载更多

我的程序人生——三年开发的思考,阿里朋友给我总结的“Java架构师技术栈”

想写这篇文章已经很久了,本来计划在3月份,也就是刚好满3年的时候写的,但是因为各种各样的原因推到了现在才开始码字。 小感慨 三年是一段很长的时间,它足够让你从高中毕业进入大学,也能让...

我最喜欢三大框架
30分钟前
0
0
ElasticSearch获取索引信息

检查集群的健康情况 GET /_cat/health?v green:每个索引的primary shard和replica shard都是active状态的 yellow:每个索引的primary shard都是active状态的,但是部分replica shard不是act...

水木星辰
32分钟前
1
0
Cesium中级教程6 - 3D Models 三维模型

Cesium中文网:http://cesiumcn.org/ | 国内快速访问:http://cesium.coinidea.com/ 3D Models 三维模型 本教程将教您如何通过Primitive API转换、加载和使用Cesium中的三维模型。如果你是C...

Cesium中文网
33分钟前
0
0
Elasticsearch简单学习1-用白话文解释原理

由于Elasticsearch在工作中用的越来越多,平时是边学边用,很少记录,读到一些很好的文章时间久了就忘记了。 所以,在此记录一下,希望对更多人的学习有帮助,知识在于分享! ==============...

wind2012
41分钟前
1
0
Spring面试题部分总结【慨念】

什么是Spring? spring是一个企业级应用的开源开发框架,主要用来开发java应用,spring框架目标就是简化企业级应用开发。 Spring用到了那些设计模式? spring里面用到了大量的设计模式,这里...

薛小二
42分钟前
5
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部