데이터 베이스 MySQL 튜토리얼 在CentOS上MySQL数据库服务器配置方法_MySQL

在CentOS上MySQL数据库服务器配置方法_MySQL

Jun 01, 2016 pm 01:20 PM
주요한 데이터 베이스 섬기는 사람 웹사이트

CentOS

bitsCN.com 无意中还找到了CentOS的专业论坛,记住:http://www.centospub.com

于是,开始的学习配置

本次环境:

CentOS系统,

mysql-server(版本忘了,因为是使用yum安装的)

过程如下(转载,根据本人安装详细要求,略加修改) :

 在提到网站构架的时候,我们经常能够看到“LAMP”的说法,它就是“Linux + Apache + MySQL + PHP”。 MySQL+PHP的协同成功案例已经很多了。比如国外的PHPBB,VBB,国内的Discuz!论坛等等程序,都是用PHP + MySQL实现的。和那些商务专用数据库比起来,MySQL的功能和规模可能被好多人说的逊色一些,但对于我们个人来说,它的功能已经算是完备。而且,通 过Discuz!官方论坛上同时在线人数的数目,也可以证明MySQL的稳定性。

  这里,介绍一下CentOS下MySQL数据库服务器的构建方法。 

安装MySQL及相关组件


  首先,安装MySQL。

[root@sample ~]# yum -y install mysql-server  ← 安装MySQL

Setting up Install Process
Setting up repositories
dag 100% |=========================| 1.1 kB 00:00
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 106 kB 00:00
update : ################################################## 261/261
Added 5 new packages, deleted 0 old in 2.02 seconds
Reducing Dag RPM Repository for Red Hat Enterprise Linux to included packages only
Finished
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for mysql-server to pack into transaction set.
mysql-server-4.1.20-1.RHE 100% |=========================| 29 kB 00:00
---> Package mysql-server.i386 0:4.1.20-1.RHEL4.1 set to be updated
--> Running transaction check
--> Processing Dependency: libmysqlclient.so.14(libmysqlclient_14) for package: mysql-server
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server
--> Processing Dependency: perl-DBI for package: mysql-server
--> Processing Dependency: perl(DBI) for package: mysql-server
--> Processing Dependency: mysql = 4.1.20-1.RHEL4.1 for package: mysql-server
--> Processing Dependency: libmysqlclient.so.14 for package: mysql-server
--> Processing Dependency: libmysqlclient_r.so.14(libmysqlclient_14) for package: mysql-server
--> Processing Dependency: libmysqlclient_r.so.14 for package: mysql-server
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for perl-DBD-MySQL to pack into transaction set.
perl-DBD-MySQL-2.9004-3.1 100% |=========================| 5.4 kB 00:00
---> Package perl-DBD-MySQL.i386 0:2.9004-3.1 set to be updated
---> Downloading header for mysql to pack into transaction set.
mysql-4.1.20-1.RHEL4.1.i3 100% |=========================| 35 kB 00:00
---> Package mysql.i386 0:4.1.20-1.RHEL4.1 set to be updated
---> Downloading header for perl-DBI to pack into transaction set.
perl-DBI-1.40-8.i386.rpm 100% |=========================| 11 kB 00:00
---> Package perl-DBI.i386 0:1.40-8 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
mysql-server i386 4.1.20-1.RHEL4.1 update 9.8 M
Installing for dependencies:
mysql i386 4.1.20-1.RHEL4.1 update 2.9 M
perl-DBD-MySQL i386 2.9004-3.1 base 111 k
perl-DBI i386 1.40-8 base 466 k

Transaction Summary
=============================================================================
Install 4 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 13 M
Downloading Packages:
(1/4): perl-DBD-MySQL-2.9 100% |=========================| 111 kB 00:00
(2/4): mysql-server-4.1.2 100% |=========================| 9.8 MB 00:11
(3/4): mysql-4.1.20-1.RHE 100% |=========================| 2.9 MB 00:03
(4/4): perl-DBI-1.40-8.i3 100% |=========================| 466 kB 00:01
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: perl-DBI ######################### [1/4]
Installing: mysql ######################### [2/4]
Installing: perl-DBD-MySQL ######################### [3/4]
Installing: mysql-server ######################### [4/4]

Installed: mysql-server.i386 0:4.1.20-1.RHEL4.1
Dependency Installed: mysql.i386 0:4.1.20-1.RHEL4.1 perl-DBD-MySQL.i386 0:2.9004-3.1 perl-DBI.i386 0:1.40-8
Complete!


  然后,安装PHP访问MySQL数据库的工具“php-mysql”。

[root@sample ~]# yum -y install php-mysql  ← 安装php-mysql

Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Reducing Dag RPM Repository for Red Hat Enterprise Linux to included packages only
Finished
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for php-mysql to pack into transaction set.
php-mysql-4.3.9-3.15.i386 100% |=========================| 18 kB 00:00
---> Package php-mysql.i386 0:4.3.9-3.15 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
php-mysql i386 4.3.9-3.15 update 35 k

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 35 k
Downloading Packages:
(1/1): php-mysql-4.3.9-3. 100% |=========================| 35 kB 00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: php-mysql ######################### [1/1]

Installed: php-mysql.i386 0:4.3.9-3.15
Complete!
配置MySQL


  然后,配置MySQL。

[root@sample ~]# vi /etc/my.cnf  ← 编辑MySQL的配置文件

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1  ← 找到这一行,在这一行的下面添加新的规则,让MySQL的默认编码为UTF-8
default-character-set = utf8  ← 添加这一行

然后在配置文件的文尾填加如下语句:

[mysql]
default-character-set = utf8
启动MySQL服务


  启动MySQL,并让MySQL在系统重新启动后随系统自动启动。

[root@sample ~]# chkconfig mysqld on  ← 设置MySQL服务随系统启动自启动

[root@sample ~]# chkconfig --list mysqld  ← 确认MySQL自启动
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off  ← 如果2--5为on的状态就OK

[root@sample ~]# /etc/rc.d/init.d/mysqld start  ← 启动MySQL服务

Initializing MySQL database:         [ OK ]
Starting MySQL:              [ OK ]
MySQL初始环境设定


[1]为MySQL的root用户设置密码

  MySQL在刚刚被安装的时候,它的root用户是没有被设置密码的。首先来设置MySQL的root密码。

[root@sample ~]# mysql -u root  ← 用root用户登录MySQL服务器

Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 2 to server version: 4.1.20

Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql> select user,host,password from mysql.user;  ← 查看用户信息
+------+------------------------------+---------------+
| user | host          | password |
+------+------------------------------+---------------+
| root | localhost        |       |  ← root密码为空 
| root | sample.centospub.com  |       |  ← root密码为空
|   | sample.centospub.com |       |
|   | localhost       |       |
+------+------------------------------+---------------+
4 rows in set (0.00 sec)

mysql> set password for root@localhost=password('在这里填入root密码');  ← 设置root密码
Query OK, 0 rows affected (0.01 sec)

mysql> set password for root@'sample.centospub.com'=password('在这里填入root密码');  ← 设置root密码
Query OK, 0 rows affected (0.01 sec)

mysql> select user,host,password from mysql.user;  ← 查看用户信息
+------+--------------------------------+--------------------------+
| user | host          | password     |
+------+--------------------------------+--------------------------+
| root | localhost        | 19b68057189b027f |  ← root密码被设置
| root | sample.centospub.com   | 19b68057189b027f |  ← root密码被设置
|    | sample.centospub.com   |          |
|    | localhost        |          |
+------+--------------------------------+--------------------------+
4 rows in set (0.01 sec)

mysql> exit  ← 退出MySQL服务器
Bye


   然后,测试一下root密码有没有生效。

[root@sample ~]# mysql -u root  ← 通过空密码用root登录

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)  ← 出现此错误信息说明密码设置成功

[root@localhost ~]# mysql -u root -h sample.centospub.com  ← 通过空密码用root登录

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)  ← 出现此错误信息说明密码设置成功

[root@sample ~]# mysql -u root -p  ← 通过密码用root登录
Enter password:  ← 在这里输入密码

Welcome to the MySQL monitor. Commands end with ; or /g.  ← 确认用密码能够成功登录
Your MySQL connection id is 5 to server version: 4.1.20

Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql> exit
Bye

[root@sample ~]# mysql -u root -h sample.centospub.com -p  ← 通过密码用root登录
Enter password:  ← 在这里输入密码

Welcome to the MySQL monitor. Commands end with ; or /g.  ← 确认用密码能够成功登录
Your MySQL connection id is 6 to server version: 4.1.20

Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql> exit  ← 退出MySQL服务器
Bye


[2] 删除匿名用户

  在MySQL刚刚被安装后,存在用户名、密码为空的用户。这使得数据库服务器有无需密码被登录的可能性。为消除隐患,将匿名用户删除。

[root@sample ~]# mysql -u root -p  ← 通过密码用root登录
Enter password:  ← 在这里输入密码

Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 7 to server version: 4.1.20

Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql> select user,host from mysql.user;  ← 查看用户信息
+------+----------------------------+
| user | host         |
+------+----------------------------+
|   | localhost       |

|   | 127.0.0.1       |
| root | localhost       |
|   | sample.centospub.com |
| root | sample.centospub.com  |
+------+----------------------------+
4 rows in set (0.02 sec)

mysql> delete from mysql.user where user='';  ← 删除匿名用户
Query OK, 2 rows affected (0.17 sec)

mysql> select user,host from mysql.user;  ← 查看用户信息
+------+----------------------------+
| user | host         |
+------+----------------------------+
| root | localhost      |
| root | sample.centospub.com |
+------+----------------------------+
2 rows in set (0.00 sec)

mysql> exit  ← 退出MySQL服务器
Bye


[3] 删除测试用数据库

   在MySQL被安装后,存在名为test的空数据库,将它删除。这里要注意的是,系统默认的还有一个名为mysql的数据库,它用于系统管理,所以请不要删除。

[root@sample ~]# mysql -u root -p  ← 通过密码用root登录
Enter password:  ← 在这里输入密码
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 8 to server version: 4.1.20

Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql> show databases;  ← 查看系统已存在的数据库
+-------------+
| Database |
+-------------+
| mysql   |
| test   |
+------------+
2 rows in set (0.02 sec)

mysql> drop database test;  ← 删除名为test的空数据库
Query OK, 0 rows affected (0.07 sec)

mysql> show databases;  ← 查看系统已存在的数据库
+-------------+
| Database |
+-------------+
| mysql   |  ← 确认名为test的数据库被删除,已不存在
+-------------+
1 row in set (0.00 sec)

mysql> exit  ← 退出MySQL服务器
Bye
测试MySQL


  下面对MySQL进行测试。包括建立新用户,以及用对关系性数据库进行数据库操作的指令来试着建立数据库及数据表。这里,新建用户以centospub为例。

[root@sample ~]# mysql -u root -p  ← 通过密码用root登录
Enter password:  ← 在这里输入密码

Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 9 to server version: 4.1.20

Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql> grant all privileges on test.* to centospub@localhost identified by '在这里定义密码';  ← 建立对test数据库有完全操作权限的名为centospub的用户
Query OK, 0 rows affected (0.03 sec)

mysql> select user from mysql.user where user='centospub';  ← 确认centospub用户的存在与否
+---------+
| user  |
+---------+
| centospub |  ← 确认centospub已经被建立
+---------+
1 row in set (0.01 sec)

mysql> exit  ← 退出MySQL服务器
Bye

[root@sample ~]# mysql -u centospub -p  ← 用新建立的centospub用户登录MySQL服务器
Enter password:  ← 在这里输入密码

Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 10 to server version: 4.1.20

Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql> create database test;  ← 建立名为test的数据库
Query OK, 1 row affected (0.00 sec)

mysql> show databases;  ← 查看系统已存在的数据库
+-------------+
| Database |
+-------------+
| test    |
+-------------+
1 row in set (0.00 sec)

mysql> use test  ← 连接到数据库
Database changed

mysql> create table test(num int, name varchar(50));  ← 在数据库中建立表
Query OK, 0 rows affected (0.03 sec)

mysql> show tables;  ← 查看数据库中已存在的表
+-------------------+
| Tables_in_test |
+-------------------+
| test     |
+-------------------+
1 row in set (0.01 sec)

mysql> insert into test values(1,'Hello World!');  ← 插入一个值到表中
Query OK, 1 row affected (0.02 sec)

mysql> select * from test;  ← 查看数据库中的表的信息
+------+-------------------+
| num | name      |
+------+-------------------+
| 1   | Hello World!  |
+------+-------------------+
1 row in set (0.00 sec)

mysql> update test set name='Hello Everyone!';  ← 更新表的信息,赋予新的值
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> select * from test;  ← 查看数据库中的表的信息
+------+----------------------+
| num | name      |
+------+----------------------+
| 1   | Hello Everyone! |  ← 确认被更新到新的值
+------+----------------------+
1 row in set (0.01 sec)

mysql> delete from test where num=1;  ← 删除表内的值
Query OK, 1 row affected (0.00 sec)

mysql> select * from test;  ← 确认删除结果
Empty set (0.01 sec)

mysql> drop table test;  ← 删除表
Query OK, 0 rows affected (0.01 sec)

mysql> show tables;  ← 查看表信息
Empty set (0.00 sec)  ← 确认表已被删除

mysql> drop database test;  ← 删除名为test的数据库
Query OK, 0 rows affected (0.01 sec)

mysql> show databases;  ← 查看已存在的数据库
Empty set (0.01 sec)  ← 确认test数据库已被删除(这里非root用户的关系,看不到名为mysql的数据库)

mysql> exit  ← 退出MySQL服务器
Bye


   然后,删除测试用过的遗留用户。

[root@sample ~]# mysql -u root -p  ← 通过密码用root登录
Enter password:  ← 在这里输入密码

Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 12 to server version: 4.1.20

Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql> revoke all privileges on *.* from centospub@localhost;  ← 取消centospub用户对数据库的操作权限
Query OK, 0 rows affected (0.00 sec)

mysql> delete from mysql.user where user='centospub' and host='localhost';  ← 删除centospub用户
Query OK, 1 row affected (0.01 sec)

mysql> select user from mysql.user where user='centospub';  ← 查找用户centospub,确认已删除与否
Empty set (0.01 sec)  ← 确认centospub用户已不存在

mysql> flush privileges;  ← 刷新,使以上操作生效
Query OK, 0 rows affected (0.01 sec)

mysql> exit
Bye


  最后,重新启动一次HTTP服务,让php-mysql反映到HTTP服务中。

[root@sample ~]# /etc/rc.d/init.d/httpd restart  ← 重新启动HTTP服务
Stopping httpd:             [ OK ]
Starting httpd:             [ OK ]

 终于搞掂!

(*^__^*) 嘻嘻……,接下来配置phpmyadmin....

bitsCN.com
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

인기 기사

R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
2 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
2 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 아무도들을 수없는 경우 오디오를 수정하는 방법
2 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

Go 언어는 데이터베이스의 추가, 삭제, 수정 및 쿼리 작업을 어떻게 구현합니까? Go 언어는 데이터베이스의 추가, 삭제, 수정 및 쿼리 작업을 어떻게 구현합니까? Mar 27, 2024 pm 09:39 PM

Go 언어는 효율적이고 간결하며 배우기 쉬운 프로그래밍 언어입니다. 동시 프로그래밍과 네트워크 프로그래밍의 장점 때문에 개발자들이 선호합니다. 실제 개발에서 데이터베이스 작업은 필수적인 부분입니다. 이 기사에서는 Go 언어를 사용하여 데이터베이스 추가, 삭제, 수정 및 쿼리 작업을 구현하는 방법을 소개합니다. Go 언어에서는 일반적으로 사용되는 SQL 패키지, Gorm 등과 같은 타사 라이브러리를 사용하여 데이터베이스를 운영합니다. 여기서는 sql 패키지를 예로 들어 데이터베이스의 추가, 삭제, 수정 및 쿼리 작업을 구현하는 방법을 소개합니다. MySQL 데이터베이스를 사용하고 있다고 가정합니다.

서버에 PHP FFmpeg 확장을 설치하는 방법은 무엇입니까? 서버에 PHP FFmpeg 확장을 설치하는 방법은 무엇입니까? Mar 28, 2024 pm 02:39 PM

서버에 PHPFFmpeg 확장을 설치하는 방법은 무엇입니까? 서버에 PHPFFmpeg 확장을 설치하면 PHP 프로젝트에서 오디오 및 비디오 파일을 처리하고 오디오 및 비디오 파일의 인코딩, 디코딩, 편집 및 처리와 같은 기능을 구현하는 데 도움이 될 수 있습니다. 이 기사에서는 서버에 PHPFFmpeg 확장을 설치하는 방법과 구체적인 코드 예제를 소개합니다. 먼저, PHP와 FFmpeg가 서버에 설치되어 있는지 확인해야 합니다. FFmpeg가 설치되어 있지 않은 경우 아래 단계에 따라 FFmpe를 설치할 수 있습니다.

Hibernate는 어떻게 다형성 매핑을 구현합니까? Hibernate는 어떻게 다형성 매핑을 구현합니까? Apr 17, 2024 pm 12:09 PM

Hibernate 다형성 매핑은 상속된 클래스를 데이터베이스에 매핑할 수 있으며 다음 매핑 유형을 제공합니다. Join-subclass: 상위 클래스의 모든 열을 포함하여 하위 클래스에 대한 별도의 테이블을 생성합니다. 클래스별 테이블: 하위 클래스별 열만 포함하는 하위 클래스에 대한 별도의 테이블을 만듭니다. Union-subclass: Joined-subclass와 유사하지만 상위 클래스 테이블이 모든 하위 클래스 열을 통합합니다.

iOS 18에는 손실되거나 손상된 사진을 검색할 수 있는 새로운 '복구된' 앨범 기능이 추가되었습니다. iOS 18에는 손실되거나 손상된 사진을 검색할 수 있는 새로운 '복구된' 앨범 기능이 추가되었습니다. Jul 18, 2024 am 05:48 AM

Apple의 최신 iOS18, iPadOS18 및 macOS Sequoia 시스템 릴리스에는 사진 애플리케이션에 중요한 기능이 추가되었습니다. 이 기능은 사용자가 다양한 이유로 손실되거나 손상된 사진과 비디오를 쉽게 복구할 수 있도록 설계되었습니다. 새로운 기능에는 사진 앱의 도구 섹션에 '복구됨'이라는 앨범이 도입되었습니다. 이 앨범은 사용자가 기기에 사진 라이브러리에 포함되지 않은 사진이나 비디오를 가지고 있을 때 자동으로 나타납니다. "복구된" 앨범의 출현은 데이터베이스 손상으로 인해 손실된 사진과 비디오, 사진 라이브러리에 올바르게 저장되지 않은 카메라 응용 프로그램 또는 사진 라이브러리를 관리하는 타사 응용 프로그램에 대한 솔루션을 제공합니다. 사용자는 몇 가지 간단한 단계만 거치면 됩니다.

HTML이 데이터베이스를 읽는 방법에 대한 심층 분석 HTML이 데이터베이스를 읽는 방법에 대한 심층 분석 Apr 09, 2024 pm 12:36 PM

HTML은 데이터베이스를 직접 읽을 수 없지만 JavaScript 및 AJAX를 통해 읽을 수 있습니다. 단계에는 데이터베이스 연결 설정, 쿼리 보내기, 응답 처리 및 페이지 업데이트가 포함됩니다. 이 기사에서는 JavaScript, AJAX 및 PHP를 사용하여 MySQL 데이터베이스에서 데이터를 읽는 실제 예제를 제공하고 쿼리 결과를 HTML 페이지에 동적으로 표시하는 방법을 보여줍니다. 이 예제에서는 XMLHttpRequest를 사용하여 데이터베이스 연결을 설정하고 쿼리를 보내고 응답을 처리함으로써 페이지 요소에 데이터를 채우고 데이터베이스를 읽는 HTML 기능을 실현합니다.

PHP에서 MySQLi를 사용하여 데이터베이스 연결을 설정하는 방법에 대한 자세한 튜토리얼 PHP에서 MySQLi를 사용하여 데이터베이스 연결을 설정하는 방법에 대한 자세한 튜토리얼 Jun 04, 2024 pm 01:42 PM

MySQLi를 사용하여 PHP에서 데이터베이스 연결을 설정하는 방법: MySQLi 확장 포함(require_once) 연결 함수 생성(functionconnect_to_db) 연결 함수 호출($conn=connect_to_db()) 쿼리 실행($result=$conn->query()) 닫기 연결( $conn->close())

PHP에서 데이터베이스 연결 오류를 처리하는 방법 PHP에서 데이터베이스 연결 오류를 처리하는 방법 Jun 05, 2024 pm 02:16 PM

PHP에서 데이터베이스 연결 오류를 처리하려면 다음 단계를 사용할 수 있습니다. mysqli_connect_errno()를 사용하여 오류 코드를 얻습니다. 오류 메시지를 얻으려면 mysqli_connect_error()를 사용하십시오. 이러한 오류 메시지를 캡처하고 기록하면 데이터베이스 연결 문제를 쉽게 식별하고 해결할 수 있어 애플리케이션이 원활하게 실행될 수 있습니다.

AMD EPYC 4004 시리즈 프로세서를 탑재한 ASUS, 다양한 서버 및 워크스테이션 제품 출시 AMD EPYC 4004 시리즈 프로세서를 탑재한 ASUS, 다양한 서버 및 워크스테이션 제품 출시 Jul 23, 2024 pm 09:34 PM

7월 23일 이 웹사이트의 뉴스에 따르면 ASUS는 AMD EPYC 4004 시리즈 프로세서로 구동되는 다양한 서버 및 워크스테이션 수준 제품을 출시했습니다. 이 사이트의 참고 사항: AMD는 지난 5월 AM5 플랫폼과 Zen4 아키텍처 EPYC 4004 시리즈 프로세서를 출시하여 최대 16코어 3DV 캐시 사양을 제공했습니다. ASUSProER100AB6 서버 ASUSProER100AB6은 EPYC Xiaolong 4004 시리즈 프로세서가 장착된 1U 랙 장착형 서버 제품으로 IDC 및 중소기업의 요구 사항에 적합합니다. ASUSExpertCenterProET500AB6 워크스테이션 ASUSExpertCenterProET500AB6은

See all articles