顯示具有 資料庫 標籤的文章。 顯示所有文章
顯示具有 資料庫 標籤的文章。 顯示所有文章

2017年3月7日 星期二

CentOS 7.3 安裝 AMP

# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)

  1. 更新
    1. yum update
  2. 安裝常用工具 (非必要)
    1. yum install mlocate
    2. yum install wget
    3. yum install zip unzip
    4. yum install ntpdate
  3. 關閉 SELINUX
    1. vi /etc/sysconfig/selinux

      SELINUX=enforcing
      改為
      SELINUX=disabled
      重開機後生效
    2. setenforce 0
      暫時關閉 SELINUX

mysql_secure_installation 設定資料庫

CentOS 7.3
如果安裝完 mariadb,在未啟動 mariadb 時直接執行指令,會出現錯誤訊息:
# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Enter current password for root (enter for none):


2012年7月13日 星期五

PHP 與 MySQL


系統:Centos6.2

Apache MySQL PHP 以 yum 安裝

/var/log/httpd/error_log 錯誤訊息
PHP Fatal error:  Call to undefined function mysql_connect() in /var/www/html/includes/adodb/drivers/adodb-mysql.inc.php on line 353

安裝 php-mysql
# yum install php-mysql.x86_64

重啟 Apacche
# service httpd restart

可以用了

2012年5月7日 星期一

XOOPS 資料庫問題

因硬碟快掛了造成資料庫錯誤
# mysqlcheck -A -o -r -p
Enter password:
xoops.block_instance
error    : Incorrect information in file: './xoops/block_instance.frm'

2012年5月4日 星期五

XOOPS 無法登入

XOOPS 無法登入
可能是資料表損毀所造成的
用 mysqlcheck 檢查並修復 (MySQL 執行中可用)

2011年12月10日 星期六

MySQL 筆記

啥都不會,慢慢記囉。

備份 MySQL 資料庫

備份
mysqldump --user=root -p mydb > /backup/mydb.sql
復原
mysqldump --user=root -p mydb < /backup/mydb.sql

2011年9月18日 星期日

安裝 phpMyAdmin


下載
http://www.phpmyadmin.net/

解壓縮
tar zxvf phpMyAdmin-3.4.5-all-languages.tar.gz

複製到網頁目錄
cp -r phpMyAdmin-3.4.5-all-languages /var/www/html/phpMyAdmin

複製設定檔
cd /var/www/html/phpMyAdmin
cp config.sample.inc.php config.inc.php

編輯設定檔
vi config.inc.php
搜尋字串$cfg['Servers'][$i]['auth_type']。
將設定值由'cookie'變更為'http'。