Change of MySQL database location not working

2019-07-10 19:01发布

Updating from WampServer 2.2 and Windows 7 to WampServer 2.5 and Windows 10. I change database and document locations with

basedir=D:/Progs/wamp/bin/mysql/mysql5.6.17
log-error=D:/Progs/wamp/logs/mysql.log
#datadir=D:/Progs/wamp/bin/mysql/mysql5.6.17/data
datadir=D:\Documents\MySQLdata

in D:\Progs\wamp\bin\mysql5.6.17\my.ini, and

#DocumentRoot "D:/Progs/wamp/www/"
DocumentRoot "D:/Documents/WWW/"
...
#<Directory "D:/Progs/wamp/www/">
<Directory "D:/Documents/WWW/">

in D:\Progs\wamp\bin\apache\apache2.4.9\conf\httpd.conf.

phpMyAdmin however still points to D:\Progs\wamp\bin\mysql\mysql5.6.17\data and new databases are made there. I am certain that the changes above worked ok in previous reinstalls of the old version in Windows 7.

1条回答
疯言疯语
2楼-- · 2019-07-10 19:35

PHPMyAdmin doesn't go with the path for dealing with the database. Instead it connects to mysql itself with the configuration for that in the file config.inc.php.

Change this in your my.ini:

# The MySQL server
[wampmysqld]

To this:

# The MySQL server
[wampmysqld64]

Restart and that should do the trick.

This was found here


Did not work here:

Since you are on Windows, look into the folder 'C:\ProgramData\MySQL\MySQL Server 5.6' (or similar) and change the my.ini there.

查看更多
登录 后发表回答