0

I have a Windows machine on which I've moved the WAMP www and MySQL data directories to Dropbox.

Those Dropbox folders have downloaded to my Ubuntu laptop.

I'd like to run the websites in /home/me/Dropbox/WAMP/WWW on my Ubuntu laptop using the MySQL data in /home/me/Dropbox/WAMP/SQL/Data.

I've edited /etc/mysql/my.cnf:

datadir=/home/me/Dropbox/WAMP/SQL/Data

I've edited /etc/apache2/sites-available/default.conf:

<VirtualHost *:80>
    DocumentRoot "\home\me\Dropbox\WAMP\WWW\site"
    ServerName www.site.dev
    ServerAlias www.site.dev
    <Directory "\home\me\Dropbox\WAMP\WWW\site">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

I've edited /etc/hosts:

127.0.0.1 www.site.dev

I've restarted apache2, and when I run www.site.dev in my browser, I am taken to the default apache2 index.html.

When I run >mysql start, I receive:

mysql: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 23!
mysql: [ERROR] Fatal error in defaults handling. Program aborted!

Line 23 of /etc/mysql/my.cnf is:

datadir=/home/me/Dropbox/WAMP/SQL/Data

Help appreciated.

From this answer, I've opened /etc/mysql/my.cnf in Sublime Text editor, and saved it as UT-8 (without BOM), and the issue remains.

Community
  • 1
  • 1
Steve
  • 2,066
  • 13
  • 60
  • 115

2 Answers2

1

Please add [mysqld] at the top of my.cnf and then restart mysql server.

service mysql restart
Adi
  • 377
  • 4
  • 9
0

the file my.cnf should be saved as ANSI encode,and [mysqld] group at the start of the file.

truestar
  • 1
  • 1