欢迎各位兄弟 发布技术文章
这里的技术是共享的
mysql默认情况下管理员是没有密码的
[root@localhost ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.95 Source distribution
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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mydb |
| mysql |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql>
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql>
mysql> show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| func |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| proc |
| procs_priv |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
17 rows in set (0.00 sec)
看下user表
mysql>
mysql> desc user;
+-----------------------+-----------------------------------+------+-----+------ ---+-------+
| Field | Type | Null | Key | Defau lt | Extra |
+-----------------------+-----------------------------------+------+-----+------ ---+-------+
| Host | char(60) | NO | PRI | | |
| User | char(16) | NO | PRI | | |
| Password | char(41) | NO | | | |
| Select_priv | enum('N','Y') | NO | | N | |
| Insert_priv | enum('N','Y') | NO | | N | |
| Update_priv | enum('N','Y') | NO | | N | |
| Delete_priv | enum('N','Y') | NO | | N | |
| Create_priv | enum('N','Y') | NO | | N | |
| Drop_priv | enum('N','Y') | NO | | N | |
| Reload_priv | enum('N','Y') | NO | | N | |
| Shutdown_priv | enum('N','Y') | NO | | N | |
| Process_priv | enum('N','Y') | NO | | N | |
| File_priv | enum('N','Y') | NO | | N | |
| Grant_priv | enum('N','Y') | NO | | N | |
| References_priv | enum('N','Y') | NO | | N | |
| Index_priv | enum('N','Y') | NO | | N | |
| Alter_priv | enum('N','Y') | NO | | N | |
| Show_db_priv | enum('N','Y') | NO | | N | |
| Super_priv | enum('N','Y') | NO | | N | |
| Create_tmp_table_priv | enum('N','Y') | NO | | N | |
| Lock_tables_priv | enum('N','Y') | NO | | N | |
| Execute_priv | enum('N','Y') | NO | | N | |
| Repl_slave_priv | enum('N','Y') | NO | | N | |
| Repl_client_priv | enum('N','Y') | NO | | N | |
| Create_view_priv | enum('N','Y') | NO | | N | |
| Show_view_priv | enum('N','Y') | NO | | N | |
| Create_routine_priv | enum('N','Y') | NO | | N | |
| Alter_routine_priv | enum('N','Y') | NO | | N | |
| Create_user_priv | enum('N','Y') | NO | | N | |
| ssl_type | enum('','ANY','X509','SPECIFIED') | NO | | | |
| ssl_cipher | blob | NO | | NULL | |
| x509_issuer | blob | NO | | NULL | |
| x509_subject | blob | NO | | NULL | |
| max_questions | int(11) unsigned | NO | | 0 | |
| max_updates | int(11) unsigned | NO | | 0 | |
| max_connections | int(11) unsigned | NO | | 0 | |
| max_user_connections | int(11) unsigned | NO | | 0 | |
+-----------------------+-----------------------------------+------+-----+------ ---+-------+
37 rows in set (0.00 sec)
mysql>
mysql> select User,Host,Password From user;
+-------+-----------------------+------------------+
| User | Host | Password |
+-------+-----------------------+------------------+
| root | localhost | | #本机 ;与 root@127.0.0.1 不是同一个用户
| root | localhost.localdomain | | #通过 # hostname命令看下 是本机名 #它的意思是客户端 是这个主机名 localhost.localdomain (而且服务器端这里 要能够解析客户端机器的名称为 localhost.localdomain )才能登录这台mysql服务器
| root | 127.0.0.1 | | #本机
| | localhost | | #没有用户名 匿名用户
| | localhost.localdomain | | #没有用户名 匿名用户
| jerry | % | 7e82afb618ffeb73 |
+-------+-----------------------+------------------+
6 rows in set (0.00 sec)
可以看出 root 用户是没办法远程登录的
mysql>
试了一下 在另一台客户端上 是无法远程登录的
在另一客户端上
通过以上 可以看出远程连不上mysql
为用户设定密码的方式:
1, 最好用它 mysql 命令行中执行 SET PASSWORD FOR 'USERNAME'@'HOST'=PASSWORD('password');
#修改的是表的内容,mysql对用户的认证是来自于内存中的,(内存重新加载users表,它才能知道密码改变)所以要清空内存,让mysql数据库重读授权表 (改了密码,或授权后 要使用 FLUSH PRIVILEGES; 让mysql数据库重读授权表)
2, 最好不要用它 linux命令行中执行 # mysqladmin -uUSENAME -hHOST -p password 'newpassord' 这表示指定老密码,并改为新密码的 (-p 表示提示要输入老密码,如果没有老密码,那么-p可以省掉)
3, 最好用它 mysql 命令行中执行(root用户身份登录)
UPDATE user SET Password=PASSWORD('newpassword') WHERE USER='root'
所有用户的root密码通通都改了
UPDATE user SET Password=PASSWORD('newpassword') WHERE USER='root' AND HOST='127.0.0.1'
只改这一个root ( host 为 '127.0.0.1' 的 root)
(
AND
OR
NOT
)
mysql> set password for 'root'@'localhost'=password('123456');
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> select User,Host,password from user;
+-------+-----------------------+------------------+
| User | Host | password |
+-------+-----------------------+------------------+
| root | localhost | 565491d704013245 | #这里显示的密码是加密的 ,如果没有使用 salt盐,其实很容易破解的
| root | localhost.localdomain | |
| root | 127.0.0.1 | |
| | localhost | |
| | localhost.localdomain | |
| jerry | % | 7e82afb618ffeb73 |
+-------+-----------------------+------------------+
6 rows in set (0.00 sec)
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> \q
Bye
[root@localhost ~]#
我没报错
[root@localhost ~]# mysqladmin -uroot -h 127.0.0.1 -p password '123456'
Enter password:
[root@localhost ~]#
马哥报错 他的意思是他的mysql 使用 127.0.0.1 还是使用localhost ;;;;;;说明他们识别的是相同的主机
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.0.95 Source distribution
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>
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select user,host,password from user;
+-------+-----------------------+------------------+
| user | host | password |
+-------+-----------------------+------------------+
| root | localhost | 565491d704013245 |
| root | localhost.localdomain | |
| root | 127.0.0.1 | 565491d704013245 |
| | localhost | |
| | localhost.localdomain | |
| jerry | % | 7e82afb618ffeb73 |
+-------+-----------------------+------------------+
6 rows in set (0.00 sec)
mysql>
马哥的 127.0.0.1 这里没有密码
说明 马哥改的还是 localhost ,,,,马哥 -h 指定127.0.0.1
mysqladmin -uroot -h 127.0.0.1 -p password '123456'
改的不是客户端 而是服务器端,,,,,,,而本地客户端仍然被识别成了 localhost
所以 mysqladmin 不能随心所欲的改变用户的密码的
字段名称不区分大小写
mysql> UPDATE user SET PASSWORD=PASSWORD('123456') WHERE USER='root' and host='127.0.0.1';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
mysql>
马哥现在这时 127.0.0.1 有密码了 ,,,而我刚才通过 mysqladmin 就有密码了
我的执行代码
mysql> select user,host,password from user; +-------+-----------------------+------------------+
| user | host | password |
+-------+-----------------------+------------------+
| root | localhost | 565491d704013245 |
| root | localhost.localdomain | |
| root | 127.0.0.1 | 565491d704013245 |
| | localhost | |
| | localhost.localdomain | |
| jerry | % | 7e82afb618ffeb73 |
+-------+-----------------------+------------------+
6 rows in set (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
把所有的root 用户都改了,
mysql> UPDATE user SET PASSWORD=PASSWORD('zhong1926') WHERE USER='root'; # 字段名是不区分大小写的
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql>
mysql> select user,host,password from user;
+-------+-----------------------+------------------+
| user | host | password |
+-------+-----------------------+------------------+
| root | localhost | 541845fa0eb17528 |
| root | localhost.localdomain | 541845fa0eb17528 |
| root | 127.0.0.1 | 541845fa0eb17528 |
| | localhost | |
| | localhost.localdomain | |
| jerry | % | 7e82afb618ffeb73 |
+-------+-----------------------+------------------+
6 rows in set (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> grant all privileges on *.* to 'root'@'192.168.%.%' identified by 'zhong1926';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> \q
Bye
[root@localhost ~]#
现在可以登录了
当然一般不建议管理员具有远程登录的权限,非常有风险,都是明文发送密码的
[root@localhost ~]# mysql -u root -p -h192.168.1.45
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.0.95 Source distribution
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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mydb |
| mysql |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql>
图形客户端工具
1,phpMyAdmin
2,Workbench
3,MySQL Front
4,Navicat 12 for MySQL
5,Toad
上图点 "确定"
php解释器运行的脚本,脚本里面的程序需要用到数据,才需要跟mysql打交道的
web 服务器
web应用程序服务器
数据库服务器
可以放在同一台主机,也可以分开来放
单层结构 :web 服务器,web应用程序服务器,数据库服务器
两层结构 A web 服务器,web应用程序服务器, B 数据库服务器
A web B web应用程序服务器,,数据库服务器
fastcgi或fpm的机制与php服务器交互,php服务器在本地与mysql服务器交互
三层结构
无论是php 还是 mysql,都是cpu密集型的 所以 cpu等不够时,就可以在每一个层次上扩展
apache+php+mysql 也可以装在同一台机器上,不够的话,再增加一台机器
#装上 php 的 mysql驱动
[root@localhost ~]# yum list all | grep mysql
This system is not registered to Red Hat Subscription Management. You can use su bscription-manager to register.
file:///media/cdrom/Server/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] 没有那个文件或目录: '/media/cdrom/Server/repodata/repomd.xml'
Trying other mirror.
mysql.i386 5.0.95-5.el5_9 installed
mysql-server.i386 5.0.95-5.el5_9 installed
apr-util-mysql.i386 1.2.7-11.el5_5.2 Cdrom_Base
freeradius-mysql.i386 1.1.3-1.6.el5 Cdrom_Base
freeradius2-mysql.i386 2.1.12-5.el5 Cdrom_Base
libdbi-dbd-mysql.i386 0.8.1a-1.2.2 Cdrom_Base
mod_auth_mysql.i386 1:3.0.0-3.2.el5_3 Cdrom_Base
mysql-bench.i386 5.0.95-5.el5_9 Cdrom_Base
mysql-connector-odbc.i386 3.51.26r1127-2.el5 Cdrom_Base
mysql-connector-odbc64.i386 5.1.8-1.el5 Cdrom_Base
mysql-devel.i386 5.0.95-5.el5_9 Cdrom_Base
mysql-test.i386 5.0.95-5.el5_9 Cdrom_Base
mysql51.i386 1-9.el5 Cdrom_Base
mysql51-build.i386 1-9.el5 Cdrom_Base
mysql51-mysql.i386 5.1.70-1.el5 Cdrom_Base
mysql51-mysql-bench.i386 5.1.70-1.el5 Cdrom_Base
mysql51-mysql-libs.i386 5.1.70-1.el5 Cdrom_Base
mysql51-mysql-server.i386 5.1.70-1.el5 Cdrom_Base
mysql51-mysql-test.i386 5.1.70-1.el5 Cdrom_Base
mysql51-runtime.i386 1-9.el5 Cdrom_Base
mysql55.i386 1-12.el5 Cdrom_Base
mysql55-build.i386 1-12.el5 Cdrom_Base
mysql55-mysql.i386 5.5.32-3.el5 Cdrom_Base
mysql55-mysql-bench.i386 5.5.32-3.el5 Cdrom_Base
mysql55-mysql-devel.i386 5.5.32-3.el5 Cdrom_Base
mysql55-mysql-libs.i386 5.5.32-3.el5 Cdrom_Base
mysql55-mysql-server.i386 5.5.32-3.el5 Cdrom_Base
mysql55-mysql-test.i386 5.5.32-3.el5 Cdrom_Base
mysql55-runtime.i386 1-12.el5 Cdrom_Base
php-mysql.i386 5.1.6-40.el5_9 Cdrom_Base
php53-mysql.i386 5.3.3-21.el5 Cdrom_Base
qt4-mysql.i386 4.2.1-1.el5_7.1 Cdrom_Base
rsyslog-mysql.i386 3.22.1-7.el5 Cdrom_Base
rsyslog5-mysql.i386 5.8.12-4.el5 Cdrom_Base
[root@localhost ~]#
[root@localhost yum.repos.d]# mount /dev/cdrom /media/cdrom/
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@localhost yum.repos.d]# yum install php-mysql
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use su bscription-manager to register.
Cdrom_Base | 1.5 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.i386 0:5.1.6-40.el5_9 set to be updated
--> Processing Dependency: php-common = 5.1.6-40.el5_9 for package: php-mysql
--> Processing Dependency: php-pdo for package: php-mysql
--> Running transaction check
---> Package php-common.i386 0:5.1.6-40.el5_9 set to be updated
---> Package php-pdo.i386 0:5.1.6-40.el5_9 set to be updated
--> Processing Conflict: php53-common conflicts php-common
--> Finished Dependency Resolution
php53-common-5.3.3-21.el5.i386 from installed has depsolving problems
--> php53-common conflicts with php-common
Error: php53-common conflicts with php-common #提示说有冲突吧,装 php53-mysql 看看
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# yum install php53-mysql
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use su bscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php53-mysql.i386 0:5.3.3-21.el5 set to be updated
--> Processing Dependency: php53-pdo for package: php53-mysql
--> Running transaction check
---> Package php53-pdo.i386 0:5.3.3-21.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php53-mysql i386 5.3.3-21.el5 Cdrom_Base 89 k
Installing for dependencies:
php53-pdo i386 5.3.3-21.el5 Cdrom_Base 68 k
Transaction Summary
================================================================================
Install 2 Package(s)
Upgrade 0 Package(s)
Total download size: 157 k
Is this ok [y/N]: y
Downloading Packages:
--------------------------------------------------------------------------------
Total 108 MB/s | 157 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php53-pdo 1/2
Installing : php53-mysql 2/2
Installed:
php53-mysql.i386 0:5.3.3-21.el5
Dependency Installed:
php53-pdo.i386 0:5.3.3-21.el5
Complete!
[root@localhost yum.repos.d]#
php连接mysql并获取数据测试
<?php
$conn = mysql_connect('localhost','root','123456');
if(!$conn){
die('Could not connect: ' .mysql_error());
}
mysql_select_db('mydb',$conn);
while ($row = mysql_fetch_array($result))
{
echo $row['Name']." ".$row['Age'];
echo "<br />";
}
?>
[root@localhost conf]# mkdir -p /www/a.org
[root@localhost conf]# vim /www/a.org/index.php
<title>A</title>
<h1>a.org</h1>
<?php
$conn=mysql_connect('localhost','root','zhong1926');
if($conn){
echo "Success...";
}
else{
echo "Failur..."
}
?>
~
[root@localhost conf]# pwd
/etc/httpd/conf
[root@localhost conf]#
[root@localhost conf]# vim httpd.conf #这个文件的最后添加上 如下的代码
.......
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /www/a.org
ServerName a.org
ErrorLog logs/a.org-error_log
CustomLog logs/a.org-access_log common
</VirtualHost>
[root@localhost conf]# service httpd restart
停止 httpd: [确定]
启动 httpd: [确定]
[root@localhost conf]#
马哥那边也报错,马哥查看它的error_log, 他那边说 装完 php53-mysql后 重启 httpd 服务器就可以了( service httpd restart )
windows 的 hosts文件下添加如下一行
192.168.1.45 a.org
查看日志
[root@localhost httpd]# pwd
/var/log/httpd
[root@localhost httpd]#
[root@localhost httpd]# tail a.org-error_log
[Tue Apr 02 05:46:11 2019] [error] [client 192.168.1.251] PHP Parse error: synt' or ';' in /www/a.org/index.php on line 10
[Tue Apr 02 05:46:20 2019] [error] [client 192.168.1.251] PHP Parse error: synt' or ';' in /www/a.org/index.php on line 10
[Tue Apr 02 05:47:28 2019] [error] [client 192.168.1.251] PHP Parse error: synt' or ';' in /www/a.org/index.php on line 10
[Tue Apr 02 05:49:04 2019] [error] [client 192.168.1.251] PHP Parse error: synt' or ';' in /www/a.org/index.php on line 10
[root@localhost httpd]# vim /www/a.org/index.php
<title>A</title>
<h1>a.org</h1>
<?php
$conn=mysql_connect('localhost','root','zhong1926');
if($conn){
echo "Success...";
}
else{
echo "Failur...";
}
?>
[root@localhost httpd]# service httpd restart
停止 httpd: [确定]
启动 httpd: [确定]
[root@localhost httpd]#
[root@localhost httpd]# service mysqld stop
停止 mysqld: [确定]
[root@localhost httpd]#
现在连不上 mysql 了
马哥使用phpmyadmin的版本
LAMP:
phpMyAdmin 管理mysql的界面
https://www.phpmyadmin.net/downloads/ 下载
https://www.phpmyadmin.net/files/ 下载历史版本
[root@localhost a.org]# wget https://files.phpmyadmin.net/phpMyAdmin/3.4.3.2/phpMyAdmin-3.4.3.2-all-languages.zip
--2019-04-02 06:08:39-- https://files.phpmyadmin.net/phpMyAdmin/3.4.3.2/phpMyAdmin-3.4.3.2-all-languages.zip
正在解析主机 files.phpmyadmin.net...
185.180.13.21
Connecting to files.phpmyadmin.net|185.180.13.21|:443... 已连接。
ERROR: cannot verify files.phpmyadmin.net's certificate, issued by `/C=US/O=DigiCert Inc/CN=DigiCert SHA2 Secure Server CA':
Issued certificate not yet valid.
ERROR: certificate common name `rsc.cdn77.org' doesn't match requested host name `files.phpmyadmin.net'.
To connect to files.phpmyadmin.net insecurely, use `--no-check-certificate'.
无法建立 SSL 连接。
[root@localhost a.org]#
[root@localhost a.org]# wget https://files.phpmyadmin.net/phpMyAdmin/3.4.3.2/phpMyAdmin-3.4.3.2-all-languages.zip --no-check-certificate
--2019-04-02 06:08:56-- https://files.phpmyadmin.net/phpMyAdmin/3.4.3.2/phpMyAdmin-3.4.3.2-all-languages.zip
正在解析主机 files.phpmyadmin.net... 185.180.13.21
Connecting to files.phpmyadmin.net|185.180.13.21|:443... 已连接。
WARNING: cannot verify files.phpmyadmin.net's certificate, issued by `/C=US/O=DigiCert Inc/CN=DigiCert SHA2 Secure Server CA':
Issued certificate not yet valid.
WARNING: certificate common name `rsc.cdn77.org' doesn't match requested host name `files.phpmyadmin.net'.
已发出 HTTP 请求,正在等待回应... 200 OK
长度:6424702 (6.1M) [application/zip]
Saving to: `phpMyAdmin-3.4.3.2-all-languages.zip'
100%[======================================>] 6,424,702 747K/s in 12s
2019-04-02 06:09:11 (512 KB/s) - `phpMyAdmin-3.4.3.2-all-languages.zip' saved [6424702/6424702]
[root@localhost a.org]#
[root@localhost a.org]# tar xf phpMyAdmin-3.4.3.2-all-languages.zip tar: 它似乎不像是一个 tar 归档文件
tar: 跳转到下一个头
tar: 归档包含过时的 base-64 头
tar: 从 phpMyAdmin-3.4.3.2-all-languages.zip 读入 4222 字节
tar: 由于前面延迟的错误而退出
[root@localhost a.org]#
[root@localhost a.org]# unzip phpMyAdmin-3.4.3.2-all-languages.zip
[root@localhost a.org]# mv phpMyAdmin-3.4.3.2-all-languages pma
[root@localhost a.org]# ls
index.php phpMyAdmin-3.4.3.2-all-languages.zip pma
[root@localhost a.org]#
windows 打开phpmyadmin
因为 mysql服务器关闭了 所以无法登录
[root@localhost a.org]# service mysqld restart
停止 mysqld: [确定]
启动 mysqld: [确定]
[root@localhost a.org]#
windows 登进来了
为了安全 最好装了 php的扩展 mcrypt
[root@localhost a.org]# yum list all | grep php53 # php53里面 没有mcrypt扩展
This system is not registered to Red Hat Subscription Management. You can use su bscription-manager to register.
php53.i386 5.3.3-21.el5 installed
php53-cli.i386 5.3.3-21.el5 installed
php53-common.i386 5.3.3-21.el5 installed
php53-mbstring.i386 5.3.3-21.el5 installed
php53-mysql.i386 5.3.3-21.el5 installed
php53-pdo.i386 5.3.3-21.el5 installed
php53-bcmath.i386 5.3.3-21.el5 Cdrom_Base
php53-dba.i386 5.3.3-21.el5 Cdrom_Base
php53-devel.i386 5.3.3-21.el5 Cdrom_Base
php53-gd.i386 5.3.3-21.el5 Cdrom_Base
php53-imap.i386 5.3.3-21.el5 Cdrom_Base
php53-intl.i386 5.3.3-21.el5 Cdrom_Base
php53-ldap.i386 5.3.3-21.el5 Cdrom_Base
php53-odbc.i386 5.3.3-21.el5 Cdrom_Base
php53-odbc64.i386 5.3.3-2.el5 Cdrom_Base
php53-pgsql.i386 5.3.3-21.el5 Cdrom_Base
php53-process.i386 5.3.3-21.el5 Cdrom_Base
php53-pspell.i386 5.3.3-21.el5 Cdrom_Base
php53-snmp.i386 5.3.3-21.el5 Cdrom_Base
php53-soap.i386 5.3.3-21.el5 Cdrom_Base
php53-xml.i386 5.3.3-21.el5 Cdrom_Base
php53-xmlrpc.i386 5.3.3-21.el5 Cdrom_Base
[root@localhost a.org]#
马哥找 php53的 mcrypt扩展
论坛:
discuz 被腾讯收购了, 开源 可以免费用,但是不能做广告赚钱(想赚钱,就得给discuz交钱) ( 一年好像3000 使用费 对方提供功能支持,升级支持什么的)
phpwind 杭州的一家公司,被阿里巴巴收购了, 开源
phpbb 国外开发,有人汉化, 开源
http://www.discuz.net/forum.php
phpwind 与 discuz 下载差不多
把论坛里面的内容聚合起来生成一个版块
CMS:
drupal:
joomla:
它们都是LAMP平台的,开源的,
discuz 历史版本下载
http://www.v2my.com/thread-2043-1-1.html
https://www.xiazaiba.com/dl/569.html
discuz 下载
http://www.discuz.net/forum.php
https://gitee.com/ComsenzDiscuz/DiscuzX
[root@localhost a.org]# wget https://xiazai.xiazaiba.com/Soft/D/Discuz_X2.5_BETA_SC_GBK_XiaZaiBa.zip
--2019-04-02 08:11:52-- https://xiazai.xiazaiba.com/Soft/D/Discuz_X2.5_BETA_SC_GBK_XiaZaiBa.zip
正在解析主机 xiazai.xiazaiba.com... 14.152.92.7, 14.152.92.3
Connecting to xiazai.xiazaiba.com|14.152.92.7|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:9817037 (9.4M) [application/zip]
Saving to: `Discuz_X2.5_BETA_SC_GBK_XiaZaiBa.zip'
100%[======================================>] 9,817,037 301K/s in 32s
2019-04-02 08:12:25 (298 KB/s) - `Discuz_X2.5_BETA_SC_GBK_XiaZaiBa.zip' saved [9817037/9817037]
[root@localhost a.org]# pwd
/www/a.org
[root@localhost a.org]#
[root@localhost a.org]#
[root@localhost a.org]# unzip Discuz_X2.5_BETA_SC_GBK_XiaZaiBa.zip
...省略掉中间解压过程中的内容
[root@localhost a.org]# ls
Discuz_X2.5 index.php
Discuz_X2.5_BETA_SC_GBK_XiaZaiBa.zip phpMyAdmin-3.4.3.2-all-languages.zip
forum.php?mod=attachment pma
[root@localhost a.org]# ls # 一不小心下载的文件, forum.php?mod=attachment ?-?Ϧ+?-??-?+?.htm 要删掉的
Discuz_X2.5 phpMyAdmin-3.4.3.2-all-languages.zip
Discuz_X2.5_BETA_SC_GBK_XiaZaiBa.zip pma
forum.php?mod=attachment ?-?Ϧ+?-??-?+?.htm
index.php
[root@localhost a.org]#
[root@localhost a.org]# rm -f *.htm
[root@localhost a.org]# ls
Discuz_X2.5 index.php
Discuz_X2.5_BETA_SC_GBK_XiaZaiBa.zip phpMyAdmin-3.4.3.2-all-languages.zip
forum.php?mod=attachment pma
[root@localhost a.org]# rm -f forum.php\?mod\=attachment
[root@localhost a.org]#
[root@localhost a.org]# cd Discuz_X2.5
[root@localhost Discuz_X2.5]# ls #upload就是网站内容
readme upload utility
[root@localhost Discuz_X2.5]#
[root@localhost Discuz_X2.5]# mkdir /www/b.net
[root@localhost Discuz_X2.5]# mv upload/* /www/b.net/
[root@localhost Discuz_X2.5]#
[root@localhost Discuz_X2.5]# vim /etc/httpd/conf/httpd.conf
......................最下面添加如下的代码
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /www/b.net
ServerName b.net
ErrorLog logs/b.net-error_log
CustomLog logs/b.net-access_log common
</VirtualHost>
在windows 的 hosts中添加一行
192.168.1.45 b.net
下面的我用不到 马哥解析不正常才用到的
通过浏览器访问是乱码
[root@localhost conf.d]# vim /etc/httpd/conf/httpd.conf # 改编码 UTF-8 或 GBK等
[root@localhost conf.d]# service httpd restart
停止 httpd: [确定]
启动 httpd: [确定]
[root@localhost conf.d]#
root@localhost b.net]# cd /www/b.net/
[root@localhost b.net]# pwd
/www/b.net
[root@localhost b.net]#
[root@localhost b.net]# chmod 777 config/ data/ data/cache/ data/avatar/ data/plugindata/ data/download/ data/template/ data/threadcache/
[root@localhost b.net]# chmod 777 data/attachment/ data/attachment/forum/ data/attachment/group/ data/log/ data/attachment/album/ uc_client/data/cache/ uc_server/data/ uc_server/data/cache/ uc_server/data/avatar/ uc_server/data/
[root@localhost b.net]#
[root@localhost b.net]# chmod 777 uc_server/data/{logs,tmp,view}
[root@localhost b.net]# chmod 777 uc_server/data/backup/
打开discuz首页
先是前台登录
然后再后台登录
[root@localhost b.net]# pwd
/www/b.net
[root@localhost b.net]# cd install/
[root@localhost install]# ls
data images include index.php
[root@localhost install]# pwd
/www/b.net/install
[root@localhost install]# mv index.php index.php.bak
[root@localhost install]#
wordpress: 全球性的人个博客系统
它就是wordpress 做的