但我现在在D盘下做项目,因此一个数据库就放在了D盘,路经是这样的:D:\eclipse\workspace\pro1\lib\db。
我找到了my.ini的配置文件中的:
datadir="C:/Program Files/MySQL/MySQL Server 5.0/Data/"
将其修改成:datadir="D:/eclipse/workspace/pro1/lib/db/"
BUT我重启的时候,MySQL服务启动不了了。而且用MySQL-Front连接的时候提示:主机127.0.0.1找不到。
在网上找了不少解决方案,但我天生愚笨,到现在还没解决,所以就只好来这里高手云集的地儿。
谢谢大家的耐心读我的问题。如果有解决方法就更好了。
谢谢大家。
5 个解决方案
#1
自己坐沙发了。
#2
使用符号链接吧,下面是mysql 5.0手册上的例子。
Suppose that the MySQL data directory is C:\mysql\data and you want to have database foo located at D:\data\foo. Set up a symlink using this procedure
Make sure that the D:\data\foo directory exists by creating it if necessary. If you already have a database directory named foo in the data directory, you should move it to D:\data. Otherwise, the symbolic link will be ineffective. To avoid problems, make sure that the server is not running when you move the database directory.
Create a text file C:\mysql\data\foo.sym that contains the pathname D:\data\foo\.
After this, all tables created in the database foo are created in D:\data\foo. Note that the symbolic link is not used if a directory with the same name as the database exists in the MySQL data directory.
假设你的mysql安装在c:\mysql,数据目录就是c:\mysql\data,现在你想在D盘建立一个名为foo的数据库,路径为d:\data\foo.
首先:保证d:\data\foo目录存在,如果没有就创建或者你c:\mysql\data下面有,就把它剪切过来,当然在停止mysql的情况下作移动,否则是不起任何作用的。
再次:在c:\mysql\data目录下建立一个文本文件命名为foo.sym,文件名与数据库名相同,后缀名为sym,里面的内容为:D:\data\foo\,就是foo数据库的绝对路径。
Suppose that the MySQL data directory is C:\mysql\data and you want to have database foo located at D:\data\foo. Set up a symlink using this procedure
Make sure that the D:\data\foo directory exists by creating it if necessary. If you already have a database directory named foo in the data directory, you should move it to D:\data. Otherwise, the symbolic link will be ineffective. To avoid problems, make sure that the server is not running when you move the database directory.
Create a text file C:\mysql\data\foo.sym that contains the pathname D:\data\foo\.
After this, all tables created in the database foo are created in D:\data\foo. Note that the symbolic link is not used if a directory with the same name as the database exists in the MySQL data directory.
假设你的mysql安装在c:\mysql,数据目录就是c:\mysql\data,现在你想在D盘建立一个名为foo的数据库,路径为d:\data\foo.
首先:保证d:\data\foo目录存在,如果没有就创建或者你c:\mysql\data下面有,就把它剪切过来,当然在停止mysql的情况下作移动,否则是不起任何作用的。
再次:在c:\mysql\data目录下建立一个文本文件命名为foo.sym,文件名与数据库名相同,后缀名为sym,里面的内容为:D:\data\foo\,就是foo数据库的绝对路径。
#3
谢谢hy2003fly()!
我试试看。怎么给分阿。
我试试看。怎么给分阿。
#4
不知好了没有分数
#5
可以了。Thx。
可是我不知怎么给分。我
我再试试看。
呵呵
可是我不知怎么给分。我
我再试试看。
呵呵
#1
自己坐沙发了。
#2
使用符号链接吧,下面是mysql 5.0手册上的例子。
Suppose that the MySQL data directory is C:\mysql\data and you want to have database foo located at D:\data\foo. Set up a symlink using this procedure
Make sure that the D:\data\foo directory exists by creating it if necessary. If you already have a database directory named foo in the data directory, you should move it to D:\data. Otherwise, the symbolic link will be ineffective. To avoid problems, make sure that the server is not running when you move the database directory.
Create a text file C:\mysql\data\foo.sym that contains the pathname D:\data\foo\.
After this, all tables created in the database foo are created in D:\data\foo. Note that the symbolic link is not used if a directory with the same name as the database exists in the MySQL data directory.
假设你的mysql安装在c:\mysql,数据目录就是c:\mysql\data,现在你想在D盘建立一个名为foo的数据库,路径为d:\data\foo.
首先:保证d:\data\foo目录存在,如果没有就创建或者你c:\mysql\data下面有,就把它剪切过来,当然在停止mysql的情况下作移动,否则是不起任何作用的。
再次:在c:\mysql\data目录下建立一个文本文件命名为foo.sym,文件名与数据库名相同,后缀名为sym,里面的内容为:D:\data\foo\,就是foo数据库的绝对路径。
Suppose that the MySQL data directory is C:\mysql\data and you want to have database foo located at D:\data\foo. Set up a symlink using this procedure
Make sure that the D:\data\foo directory exists by creating it if necessary. If you already have a database directory named foo in the data directory, you should move it to D:\data. Otherwise, the symbolic link will be ineffective. To avoid problems, make sure that the server is not running when you move the database directory.
Create a text file C:\mysql\data\foo.sym that contains the pathname D:\data\foo\.
After this, all tables created in the database foo are created in D:\data\foo. Note that the symbolic link is not used if a directory with the same name as the database exists in the MySQL data directory.
假设你的mysql安装在c:\mysql,数据目录就是c:\mysql\data,现在你想在D盘建立一个名为foo的数据库,路径为d:\data\foo.
首先:保证d:\data\foo目录存在,如果没有就创建或者你c:\mysql\data下面有,就把它剪切过来,当然在停止mysql的情况下作移动,否则是不起任何作用的。
再次:在c:\mysql\data目录下建立一个文本文件命名为foo.sym,文件名与数据库名相同,后缀名为sym,里面的内容为:D:\data\foo\,就是foo数据库的绝对路径。
#3
谢谢hy2003fly()!
我试试看。怎么给分阿。
我试试看。怎么给分阿。
#4
不知好了没有分数
#5
可以了。Thx。
可是我不知怎么给分。我
我再试试看。
呵呵
可是我不知怎么给分。我
我再试试看。
呵呵