近期买了个域名,想要玩玩自己建站点:接下来遇到的问题都会一次记录下来。以备自己以后复习查看:
首先建站方案选择: wordPress +centos6.5 +mysql;

server买的:搬瓦工最低配置,事实上主要用来使用vpn。(
你懂的,感兴趣的能够翻看我曾经的博客)。

 地址:https://bandwagonhost.com 

wordpress 下载地址:https://cn.wordpress.org

域名是百度开放云买的。推荐,非常优惠啊!


第一个问题:centos6.5下安装mysql: 參考链接:http://www.centoscn.com/mysql/2014/0812/3481.html



1.使用yum命令安装mysql
[html] view plaincopy
  1. [root@bogon ~]#  yum -y install mysql-server
2.设置开机启动
[html] view plaincopy
  1. [root@bogon ~]#  chkconfig mysqld on
3.启动MySQL服务
[html] view plaincopy
  1. [root@bogon ~]#  service mysqld start
4.设置MySQL的root用户设置密码
[html] view plaincopy
  1. [root@bogon ~]#  mysql -u root
  2. mysql> select user,host,password from mysql.user;
  3. +------+-----------+----------+
  4. | user | host      | password |
  5. +------+-----------+----------+
  6. | root | localhost |          |
  7. | root | bogon     |          |
  8. | root | 127.0.0.1 |          |
  9. |      | localhost |          |
  10. |      | bogon     |          |
  11. +------+-----------+----------+
  12. 5 rows in set (0.01 sec)
查询用户的密码,都为空。用以下的命令设置root的密码为root
[html] view plaincopy
  1. mysql> set password for root@localhost=password('root');
  2. mysql> exit
5.用新密码登陆
[html] view plaincopy
  1. [root@bogon ~]#  mysql -u root -p
  2. Enter password:
6.创建mysql新用户test_user
[html] view plaincopy
  1. mysql> create user 'test_user'@'%' identified by 'test_user';
  2. Query OK, 0 rows affected (0.00 sec)
7.给新用户test_user授权,让他能够从外部登陆和本地登陆
注意:@左边是username,右边是域名、IP和%。表示能够訪问mysql的域名和IP,%表示外部不论什么地址都能訪问。
[html] view plaincopy
  1. mysql> grant all privileges on *.* to 'test_user'@'localhost' identified by 'test_user';
  2. Query OK, 0 rows affected (0.00 sec)
  3. mysql> grant all privileges on *.* to 'test_user'@'%' identified by 'test_user';
  4. Query OK, 0 rows affected (0.00 sec)
  5. mysql> select user,host,password from mysql.user;
  6. +----------+-----------+-------------------------------------------+
  7. | user     | host      | password                                  |
  8. +----------+-----------+-------------------------------------------+
  9. | root     | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
  10. | root     | bogon     |                                           |
  11. | root     | 127.0.0.1 |                                           |
  12. |          | localhost |                                           |
  13. |          | bogon     |                                           |
  14. | test_user | %         | *3046CF87132BBD4FDDF06F321C6859074843B7D3 |
  15. | test_user | localhost | *3046CF87132BBD4FDDF06F321C6859074843B7D3 |
  16. +----------+-----------+-------------------------------------------+
  17. 7 rows in set (0.00 sec)
  18. mysql> flush privileges;
  19. Query OK, 0 rows affected (0.01 sec)
8.查看mysql5.1的默认存储引擎
从以下的运行结果能够看出,mysql的默认引擎是MyISAM。这个引擎是不支持事务的。
[html] view plaincopy
  1. mysql> show engines;
  2. +------------+---------+------------------------------------------------------------+--------------+------+------------+
  3. | Engine     | Support | Comment                                                    | Transactions | XA   | Savepoints |
  4. +------------+---------+------------------------------------------------------------+--------------+------+------------+
  5. | MRG_MYISAM | YES     | Collection of identical MyISAM tables                      | NO           | NO   | NO         |
  6. | CSV        | YES     | CSV storage engine                                         | NO           | NO   | NO         |
  7. | MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance     | NO           | NO   | NO         |
  8. | InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |
  9. | MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables  | NO           | NO   | NO         |
  10. +------------+---------+------------------------------------------------------------+--------------+------+------------+
  11. 5 rows in set (0.00 sec)
也能够以以下的方式查看
[html] view plaincopy
  1. mysql> show variables like 'storage_engine';
  2. +----------------+--------+
  3. | Variable_name  | Value  |
  4. +----------------+--------+
  5. | storage_engine | MyISAM |
  6. +----------------+--------+
  7. 1 row in set (0.00 sec)
9.改动mysql的默认引擎为InnoDB
9.1 停止mysql
[html] view plaincopy
  1. mysql> exit;
  2. [root@bogon ~]# service mysqld stop
9.2 改动/etc/my.cnf
[mysqld] 后加入
[html] view plaincopy
  1. default-storage-engine=InnoDB
加入后my.cnf的内容为:
[html] view plaincopy
  1. [root@bogon etc]# more my.cnf
  2. [mysqld]
  3. datadir=/var/lib/mysql
  4. socket=/var/lib/mysql/mysql.sock
  5. user=mysql
  6. # Disabling symbolic-links is recommended to prevent assorted security risks
  7. symbolic-links=0
  8. default-storage-engine=InnoDB
  9. [mysqld_safe]
  10. log-error=/var/log/mysqld.log
  11. pid-file=/var/run/mysqld/mysqld.pid
9.3 启动mysql
[html] view plaincopy
  1. [root@bogon etc]# service mysqld start
  2. Starting mysqld:  [  OK  ]
9.4 查看mysql默认存储引擎
[html] view plaincopy
  1. [root@bogon etc]# mysql -u root -p
  2. Enter password:
  3. Welcome to the MySQL monitor.  Commands end with ; or \g.
  4. Your MySQL connection id is 2
  5. Server version: 5.1.73 Source distribution
  6. Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
  7. Oracle is a registered trademark of Oracle Corporation and/or its
  8. affiliates. Other names may be trademarks of their respective
  9. owners.
  10. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  11. mysql> show variables like 'storage_engine';
  12. +----------------+--------+
  13. | Variable_name  | Value  |
  14. +----------------+--------+
  15. | storage_engine | InnoDB |
  16. +----------------+--------+
  17. 1 row in set (0.00 sec)
10.CentOS6.5开放mysql端口3306
CentOS6.5默认是不开放端口的。假设要让外部的系统訪问CentOS6.5上的mysql,必须开放mysql的端口3306
10.1 改动/etc/sysconfig/iptables
加入以下一行
[html] view plaincopy
  1. -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
改动后iptables中的内容是
[html] view plaincopy
  1. [root@bogon etc]# more /etc/sysconfig/iptables
  2. # Firewall configuration written by system-config-firewall
  3. # Manual customization of this file is not recommended.
  4. *filter
  5. :INPUT ACCEPT [0:0]
  6. :FORWARD ACCEPT [0:0]
  7. :OUTPUT ACCEPT [0:0]
  8. -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  9. -A INPUT -p icmp -j ACCEPT
  10. -A INPUT -i lo -j ACCEPT
  11. -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
  12. #加入配置项
  13. -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
  14. -A INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT
  15. -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
  16. -A INPUT -j REJECT --reject-with icmp-host-prohibited
  17. -A FORWARD -j REJECT --reject-with icmp-host-prohibited
  18. COMMIT
11.重新启动防火墙
[html] view plaincopy
  1. [root@bogon etc]# service iptables restart

建站笔记1:centos6.5下安装mysql的更多相关文章

  1. centos6.5下安装mysql数据库

    centos6.5下安装mysql数据库 1.安装mysql数据库:yum install mysql-server 2.临时启动数据库:service mysqld start 3.开机启动数据库: ...

  2. centos6.4下安装mysql

    一.mysql简介 说到数据库,我们大多想到的是关系型数据库,比如mysql.oracle.sqlserver等等,这些数据库软件在windows上安装都非常的方便,在Linux上如果要安装数据库,咱 ...

  3. centos6.5下安装mysql

    http://www.centoscn.com/mysql/2014/0812/3481.html 1.使用yum命令安装mysql [root@bogon ~]#  yum -y install m ...

  4. CentOS6.8下安装mysql

    转自https://blog.csdn.net/jeffleo/article/details/53559712?utm_source=itdadao&utm_medium=referral ...

  5. CentOS6.7下安装MySQL

    第一步:到MySQL官网上下载linux版本的MySQL rpm 安装包. 第二步: 将该压塑包解压后,有如下文件: 第三步:安装文件,我们需要安装的文件有 MySQL-server-5.6.26-1 ...

  6. linux centos6.8 下安装mysql 步骤

    安装环境:vmware12.centos6.8.centos中配置阿里云数据元 1.下载mysql 运行: sudo yum -y install mysql-server 如果下载失败,可以卸载重新 ...

  7. 【转载】CentOS6.5_X64下安装配置MongoDB数据库

    [转载]CentOS6.5_X64下安装配置MongoDB数据库 2014-05-16 10:07:09|  分类: 默认分类|举报|字号 订阅      下载LOFTER客户端 本文转载自zhm&l ...

  8. centos 6.5下安装mysql+nginx+redmine 3.1.0 笔记

    centos 6.5下安装mysql+nginx+redmine 3.1.0 笔记 目录[-] 过程 1.安装RVM 2.利用rvm安装 Ruby 1.9.3 并设为默认 3.安装rails 4.安装 ...

  9. CentOS6.5下安装apache2.2和PHP 5.5.28

    CentOS6.5下安装apache2.2 1. 准备程序 :httpd-2.2.27.tar.gz 下载地址:http://httpd.apache.org/download.cgi#apache2 ...

随机推荐

  1. python的Django使用mysql基本操作

    环境:Centos6.6 ,python2.6 准备工作: mysql的安装,以及MySQL-python的安装 http://www.cnblogs.com/zychengzhiit1/p/4437 ...

  2. upm配置文件

    组件配置说明 Ø 配置文件规范 Ø 组件分为公共组件和私有组件,分别在public段和private段,如下所示. <?xml version="1.0" encoding= ...

  3. 20162304 实验二《Java面向对象程序设计》实验报告

    20162304 实验二<Java面向对象程序设计>实验报告 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S.O.L.I.D原则 ...

  4. [转]SSH包全解

    Struts2 Core Libraries 必须引入的包 : struts2-core.jar——Struts2的核心包 xwork-core.jar——Command模式框架,WebWork和St ...

  5. storm性能优化

    Storm 性能优化 目录 场景假设 调优步骤和方法 Storm 的部分特性 Storm 并行度 Storm 消息机制 Storm UI 解析 性能优化 场景假设 在介绍 Storm 的性能调优方法之 ...

  6. Xcode9出现错误safe area layout guide before ios 9 真正解决办法

    网上很多解决办法瞎扯淡,以讹传讹之势愈演愈烈. 正解是选中控制器,右边面板的Builds for 选择iOS9.0 and Later,如下图红框广为流传的错解是不勾选Use Safe Area La ...

  7. ocx控件打印之基础篇

      Visual C++6.0是开发Windows应用程序的强大工具,但是要通过它实现程序的打印功能,一直是初学者的一个难点,经常有朋友询问如何在VC中实现打印功能,他们往往感到在MFC提供的框架内实 ...

  8. .net 4.5如何使用Async和Await进行异步编程

    通过使用异步编程,可避免出现性能瓶颈,并提高应用程序的整体响应.然而,技术编写异步应用程序的传统方法过于复杂,这使得异步程序难以编写,调试和维护. Visual Studio2012引入了一个简单的开 ...

  9. javascript不依赖JS加载顺序事件对象实现

    背景: 在现在WEB开发中,稍复杂一点的页面,都会涉及到多个模块,尤其是类似seajs.LABjs.requireJS等模块工具出来后,前端开发者分模块开发已经慢慢变成一种习惯了,但是多个模块间的常常 ...

  10. [转]SSIS数据转换组件_派生列、审核、字符映射转换和条件性拆分转换

    本文转自:http://www.cnblogs.com/gudujianxiao/archive/2012/04/14/2446925.html 一 派生列 派生列转换通过对输入列进行类型转换或应用表 ...