錯誤訊息:
缺少 mcrypt 擴充套件。請檢查 PHP 設定。
解法:
先檢查伺服器有無安裝php5-mcrypt
$ dpkg --get-selections | grep mcrypt
啟用
# php5enmod mcrypt
重新啟動apache
# service apache2 restart
參考資料:
http://reader.roodo.com/jaytech/archives/32814872.html
將datetime預設值為NOW()
將欄位Type改成TIMESTAMP ,然後Default設 CURRENT_TIMESTAMP ,但Mysql一張表只能有一個TIMESTAMP,如這樣表有兩個欄位,如new_time和update_time,則其中一個在insert時只能手動寫NOW() 到SQL上
連線遠端資料庫
http://stackoverflow.com/questions/16801573/how-to-access-remote-server-with-local-phpmyadmin-client
編輯 config.inc.php ,在檔案最底下加入
$i++;
$cfg['Servers'][$i]['host'] = '192.168.x.x:3306'; //provide hostname and port if other than default
$cfg['Servers'][$i]['user'] = 'root'; //user name for your remote server
$cfg['Servers'][$i]['password'] = 'password'; //password
$cfg['Servers'][$i]['auth_type'] = 'config'; // keep it as config
勿直接改 上面 First server (本機)裡面的設定,否則會報錯:
#1146 - Table 'phpmyadmin.pma__tracking' doesn't exist
移動欄位順序
http://stackoverflow.com/questions/1962448/php-myadmin-change-field-order-move-up-or-down
在瀏覽結構頁籤時,下方有 Move columns( 移动字段 ) 這邊有GUI可以操作
或直接下SQL:
ALTER TABLE `table_name` MODIFY `column_you_want_to_move` DATATYPE AFTER `column`
最新版線上測試
http://demo.phpmyadmin.net/STABLE/
http://demo.phpmyadmin.net/QA_4_5/ ( https://github.com/phpmyadmin/phpmyadmin 上的QA_4_5 branch )
帳號: root
密碼: (空)
https://wiki.phpmyadmin.net/pma/Release_Targets
A QA branch is created with the first release candidate for each version (for instance, QA_4_0 was created for the release of 4.0.0-rc1). Bug fixes for that release should target the QA branch.
We try to fix bugs in the most recent QA branch, ...
什麼是QA分支?他是每個版本第一個發佈的候選人,bug在最近的QA分支上修復...
連結docker mysql:5.6
下載docker mysql 5.6
# docker pull mysql:5.6
啟動docker mysql:5.6,將mysql的port對應到master的3307 port,可先在master 檢查3307 有沒有被其他進程佔用( $ ps aux | grep 3307 )
# docker run -t -i -p 3307:3306 mysql:5.6 bash
因為docker mysql:5.6 root的預設密碼為空,但沒開放給別的ip連,如果要讓別台機器連docker mysql:5.6
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' ;
在phpmyadmin的 config.inc.php 設定docker mysql:5.6的連線方式後出現錯誤:
無法連線: 設定錯誤.
解法:
開一個有密碼的使用者去連
mysql> CREATE USER 'user'@'%' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'user'@'%';
然後在phpmyadmin config.inc.php 最下面加入下面設定
$i++;
$cfg['Servers'][$i]['host'] = '192.168.169.147:3307'; //provide hostname and port if other than default
$cfg['Servers'][$i]['user'] = 'user'; //user name for your remote server
$cfg['Servers'][$i]['password'] = 'password'; //password
$cfg['Servers'][$i]['auth_type'] = 'config'; // keep it as config
最後即可以phpmyadmin訪問 docker mysql:5.6的資料庫了
#1146 - Table 'phpmyadmin.pma__tracking' doesn't exist 和 #1146 - Table 'phpmyadmin.pma__recent' doesn't exist 錯誤
事情是這樣子的,我虛擬機的MySQL移除後重裝Percona 5.7版本,所以把datadir的/var/lib/mysql/ 直接砍掉重建,但沒備份phpmyadmin這個db(不確定原本有沒有)
這時候裝好Percona 5.7 打開phpmyadmin左側菜單想要看新建的sbtest表,結果報錯
#1146 - Table 'phpmyadmin.pma__tracking' doesn't exist
http://stackoverflow.com/questions/24055394/1146-table-phpmyadmin-pma-tracking-doesnt-exist
直接執行 create_tables.sql 報錯
#1146 - Table 'phpmyadmin.pma__recent' doesn't exist
解法:在console 上進mysql 建立phpmyadmin表後,先手動執行以下SQL
CREATE TABLE IF NOT EXISTS `pma__tracking` ( `db_name` varchar(64) NOT NULL, `table_name` varchar(64) NOT NULL, `version` int(10) unsigned NOT NULL, `date_created` datetime NOT NULL, `date_updated` datetime NOT NULL, `schema_snapshot` text NOT NULL, `schema_sql` text, `data_sql` longtext, `tracking` set('UPDATE','REPLACE','INSERT','DELETE','TRUNCATE','CREATE DATABASE','ALTER DATABASE','DROP DATABASE','CREATE TABLE','ALTER TABLE','RENAME TABLE','DROP TABLE','CREATE INDEX','DROP INDEX','CREATE VIEW','ALTER VIEW','DROP VIEW') default NULL, `tracking_active` int(1) unsigned NOT NULL default '1', PRIMARY KEY (`db_name`,`table_name`,`version`) ) COMMENT='Database changes tracking for phpMyAdmin' DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
再到phpmyadmin執行SQL create_tables.sql
或使用
http://stackoverflow.com/questions/12760394/1146-table-phpmyadmin-pma-recent-doesnt-exist
$ sudo dpkg-reconfigure phpmyadmin (未嘗試)
沒有留言:
張貼留言