在CentOS系统中,安装SQLAdmin(假设你指的是phpMyAdmin,因为SQLAdmin并不是一个常见的软件名称)的步骤如下:
更新系统包
sudo yum update -y
安装EPEL仓库
sudo yum install epel-release -y
安装phpMyAdmin
sudo yum install phpmyadmin -y
配置phpMyAdmin
/etc/httpd/conf.d/phpMyAdmin.conf 或 /etc/nginx/conf.d/default.conf,确保PHP-FPM或PHP模块已启用。sudo systemctl restart httpd # 对于Apache
sudo systemctl restart nginx # 对于Nginx
访问phpMyAdmin
打开浏览器,访问 http://your_server_ip/phpmyadmin,使用默认用户名和密码登录(通常是root)。
下载phpMyAdmin
wget https://files.phpmyadmin.net/phpMyAdmin/5.1.1/phpMyAdmin-5.1.1-all-languages.tar.gz
解压文件
sudo tar -zxvf phpMyAdmin-5.1.1-all-languages.tar.gz -C /usr/share/
重命名目录
sudo mv /usr/share/phpMyAdmin-5.1.1-all-languages /usr/share/phpmyadmin
配置Web服务器
对于Apache:
编辑 /etc/httpd/conf.d/phpMyAdmin.conf:
Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin/>
Require all granted
</Directory>
重启Apache:
sudo systemctl restart httpd
对于Nginx:
编辑 /etc/nginx/conf.d/default.conf:
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpeg|jpg|png|css|gif|ico|js|html|xml|ttf|woff|woff2|svg))$ {
root /usr/share/;
}
}
重启Nginx:
sudo systemctl restart nginx
访问phpMyAdmin
打开浏览器,访问 http://your_server_ip/phpmyadmin,使用默认用户名和密码登录(通常是root)。
希望这些步骤能帮助你在CentOS上成功安装phpMyAdmin!如果有任何问题,请随时提问。