当前位置: 首页 > news >正文

建设部精神文明建设网站零用贷网站如何做

建设部精神文明建设网站,零用贷网站如何做,简易h5制作开发,百度推广业务电话1、安装方法 mysql安装常见的方法有四种 序号安装方式说明1yum\rpm简单、快速,不能定制参数2二进制解压,简单配置就可使用 免安装 mysql-a.b.c-linux2.x-x86_64.tar.gz3源码编译可以定制参数,安装时间长 mysql-a.b.c.tar.gz4源码制成rpm包把…

1、安装方法

mysql安装常见的方法有四种

序号安装方式说明
1yum\rpm简单、快速,不能定制参数
2二进制解压,简单配置就可使用 免安装 mysql-a.b.c-linux2.x-x86_64.tar.gz
3源码编译可以定制参数,安装时间长 mysql-a.b.c.tar.gz
4源码制成rpm包把源码制作成符合要求的rpm,通过yum安装

2、安装步骤

创建mysql 用户

groupadd mysql

useradd -s /sbin/nologin -g mysql -M mysql (不创建家目录)

获取软件包

可以选择国内的sohu镜像站点下载

Index of /mysql/ 可以选择自己要使用的其他版本

http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.55-linux2.6-x86_64.tar.gz

二进制安装

[root@bj-web-001 opt]# cd  /opt/

[root@bj-web-001 opt]#wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.55-linux2.6-x86_64.tar.gz

[root@bj-web-001 opt]# tar xf mysql-5.5.55-linux2.6-x86_64.tar.gz 

[root@bj-web-001 opt]# ln -s mysql-5.5.55-linux2.6-x86_64 mysql

[root@bj-web-001 opt]# ls -l mysql

lrwxrwxrwx 1 root root 28  6月 27 22:13 mysql -> mysql-5.5.55-linux2.6-x86_64

[root@bj-web-001 mysql]# ls -l support-files/*.cnf

-rw-r--r-- 1 7161 31415  4691  3月 18 13:14 support-files/my-huge.cnf

-rw-r--r-- 1 7161 31415 19759  3月 18 13:14 support-files/my-innodb-heavy-4G.cnf

-rw-r--r-- 1 7161 31415  4665  3月 18 13:14 support-files/my-large.cnf

-rw-r--r-- 1 7161 31415  4676  3月 18 13:14 support-files/my-medium.cnf

-rw-r--r-- 1 7161 31415  2840  3月 18 13:14 support-files/my-small.cnf

[root@bj-web-001 mysql]# /bin/cp support-files/my-small.cnf /etc/my.cnf 

[root@bj-web-001 ~]# chown -R mysql.mysql /opt/mysql/

[root@bj-web-001 ~]# ll /opt/mysql/                        

总用量 72

drwxr-xr-x  2 mysql mysql  4096  6月 27 22:08 bin

-rw-r--r--  1 mysql mysql 17987  3月 18 12:41 COPYING

drwxr-xr-x  3 mysql mysql  4096  6月 27 22:08 data

drwxr-xr-x  2 mysql mysql  4096  6月 27 22:08 docs

drwxr-xr-x  3 mysql mysql  4096  6月 27 22:08 include

-rw-r--r--  1 mysql mysql   301  3月 18 12:41 INSTALL-BINARY

drwxr-xr-x  3 mysql mysql  4096  6月 27 22:09 lib

drwxr-xr-x  4 mysql mysql  4096  6月 27 22:08 man

drwxr-xr-x 10 mysql mysql  4096  6月 27 22:09 mysql-test

-rw-r--r--  1 mysql mysql  2496  3月 18 12:41 README

drwxr-xr-x  2 mysql mysql  4096  6月 27 22:08 scripts

drwxr-xr-x 27 mysql mysql  4096  6月 27 22:09 share

drwxr-xr-x  4 mysql mysql  4096  6月 27 22:08 sql-bench

drwxr-xr-x  2 mysql mysql  4096  6月 27 22:08 support-files

[root@bj-web-001 ~]# /opt/mysql/scripts/mysql_install_db --basedir=/opt/mysql --datadir=/opt/mysql/data/ --user=mysql

[root@bj-web-001 ~]# tree /opt/mysql/data/

/opt/mysql/data/

├── mysql

│   ├── columns_priv.frm

│   ├── columns_priv.MYD

│   ├── columns_priv.MYI

│   ├── db.frm

│   ├── db.MYD

│   ├── db.MYI

│   ├── event.frm

│   ├── event.MYD

│   ├── event.MYI

│   ├── func.frm

│   ├── func.MYD

│   ├── func.MYI

[root@bj-web-001 mysql]# cp support-files/mysql.server /etc/init.d/mysqld

[root@bj-web-001 mysql]# chmod +x /etc/init.d/mysqld 

[root@bj-web-001 mysql]# sed -i 's#/usr/local/mysql#/opt/mysql#g' /opt/mysql/bin/mysqld_safe /etc/init.d/mysqld 

[root@bj-web-001 mysql]# /etc/init.d/mysqld start

Starting MySQL.Logging to '/opt/mysql/data/bj-web-001.err'.

. SUCCESS! 

还可以使用 (2选1)

[root@bj-web-001 mysql]# /opt/mysql/bin/mysqld_safe --user=mysql &

[root@bj-web-001 mysql]# netstat -ntpl|grep mysql

tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      58844/mysqld  

要是启动失败,需要查看日志

[root@bj-web-001 mysql]# tail -f data/bj-web-001.err 

InnoDB: Creating foreign key constraint system tables

InnoDB: Foreign key constraint system tables created

设置开机启动

[root@bj-web-001 data]# chkconfig --add mysqld

[root@bj-web-001 data]# chkconfig mysqld on

[root@bj-web-001 data]# chkconfig --list mysqld

mysqld          0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭

配置环境变量

[root@bj-web-001 data]# echo 'export PATH=/opt/mysql/bin:$PATH' >> /etc/profile

[root@bj-web-001 data]# tail -1 /etc/profile

export PATH=/opt/mysql/bin:$PATH

[root@bj-web-001 data]# source /etc/profile

[root@bj-web-001 data]# echo $PATH

/opt/mysql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

测试登录

[root@bj-web-001 data]# mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.5.55 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, 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> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| test               |

+--------------------+

4 rows in set (0.00 sec)

mysql> select user();

+----------------+

| user()         |

+----------------+

| root@localhost |

+----------------+

1 row in set (0.00 sec)

mysql> \q

Bye


设置密码

[root@bj-web-001 data]# mysqladmin -u root password '123456'

[root@bj-web-001 data]# mysql

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

[root@bj-web-001 data]# 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.5.55 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, 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> 


删除无用账户

mysql> DELETE FROM mysql.user WHERE user = ''; [删除匿名帐户]

mysql> select user,host from mysql.user;

+------+------------+

| user | host       |

+------+------------+

| root | 127.0.0.1  |

| root | ::1        |

|      | bj-web-001 |

| root | bj-web-001 |

|      | localhost  |

| root | localhost  |

+------+------------+

6 rows in set (0.00 sec)

mysql> drop user "root"@"::1";

Query OK, 0 rows affected (0.00 sec)

mysql> drop user ""@"localhost";    

Query OK, 0 rows affected (0.00 sec)

mysql> drop user ""@"bj-web-001";       

Query OK, 0 rows affected (0.00 sec)

mysql> drop user "root"@"bj-web-001";

Query OK, 0 rows affected (0.00 sec)

mysql> select user,host from mysql.user;

+------+-----------+

| user | host      |

+------+-----------+

| root | 127.0.0.1 |

| root | localhost |

+------+-----------+

2 rows in set (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)


删除无用数据库

mysql> drop database test;

Query OK, 0 rows affected (0.00 sec)

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

+--------------------+

3 rows in set (0.00 sec)

mysql> 

    

        至此,二进制安装mysql数据库完成。

http://www.yayakq.cn/news/57299/

相关文章:

  • 网站的内部推广的方法wordpress标题在那个文件里
  • 百度做网站的天津哪家制作网站好
  • 现在那个网站做视频最赚钱网站权重下降原因
  • 南京微信网站开发网站seo新闻
  • 网站开发的工作流程微信软文案例
  • 发卡平台网站建设优秀的网站设计案例
  • 网站后台和前台设计网页报价
  • 工商工事上哪个网站做深圳外贸网站优化
  • 秦皇岛网站群发关键词杭州开发小程序公司
  • html5网站搭建免费手机虚拟机
  • 基于wordpress个人博客网站论文建设银行沈阳分行网站
  • 外贸自助建站dw软件可以做哪些网站
  • 石家网站建设公司排名石家庄本地招聘信息网
  • 网网站开发站制作公司微模板网站建设
  • 青岛网站设计建议i青岛博采网络用php做注册网站的代码
  • 建设网站专业加强网站建设和信息公开
  • wordpress仿站上传到SEO案例网站建设公司
  • 域名网站备案管理系统色一把做最好的看片网站
  • 网站建设引领者做购物网站多少钱
  • 做国内学历公证的网站手机制作视频
  • 自学编程做点网站赚钱金品诚企网站建设
  • 最好建网站系统的软件网站建设推广有没有
  • 如何评估一个网站100m做电影网站
  • 汉中网站建设报价古镇网站建设哪家好
  • 服务周到的做网站网页制作基础教程本社
  • 网站科技感颜色高效网站建设
  • 网站换肤代码做网站主要用什么软件
  • 电子商务网站建设规划论文如何制作网页链接
  • 北京高端it网站建设wordpress theme开发
  • App网站建设 高品质网站建设苏州市著名网站制作