Hi,
I run a Mac with MAMP. I've done everything as the readme and tutorial.markdown says. I've set up akelos_framework, akelos_framework_dev and akelos_framework_tests databases and have written an xxx_installer.php file. But when I run the ./script/migrate xxx install command I get this error:
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in
/Users/alfner/akelos_framework/vendor/adodb/drivers/adodb-mysql.inc.php on line 349
Connection to the database failed. mysqlt://root:******@localhost/akelos_framework_dev
Thanks for any advice on this!
It is possible that your MySQL server is not running on port 3306 (MySQL default port) but on MAMPs MySQL port 8889.
Try to change the port number or try specifying MAMPs socket directly with the option
'socket' => '/Applications/MAMP/tmp/mysql/mysql.sock'
Do you get the same error when using the socket option?
How do I use the socket option?
By adding the socket option in yout config/config.php file
$database_settings = array(
'production' => array(
'type' => 'mysql',
'socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
'database_name' => 'my_db_name',
'user' => 'root',
'password' => '',
'options' => '',
),
// and all the other environment settings
);
Ahh, didn't understand where to put it first...
...I get the same error though:
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in
/Users/alfner/akelos_framework/vendor/adodb/drivers/adodb-mysql.inc.php on line 349
Connection to the database failed. mysqlt://root:******@localhost/akelos_framework_dev
Can you check that
ls -al /var/mysql/mysql.soc*
points to MAMP socket?
/var/mysql/mysql.sock -> /Applications/MAMP/tmp/mysql/mysql.sock
Can you connect to the database using...?
/Applications/MAMP/Library/bin/mysql -uroot -pyourpass yourdbname
I don't know if I understood you right but when i run:
AlfredMacBookPro:~/akelos_framework alfner$ ls -al /Applications/MAMP/tmp/mysql/mysql.sock
I get:
srwxrwxrwx 1 alfner admin 0 Nov 16 21:28 /Applications/MAMP/tmp/mysql/mysql.sock
and I can't connect:
AlfredMacBookPro:~/akelos_framework alfner$ /Applications/MAMP/Library/bin/mysql -root -root akelos_framework_dev
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'akelos_framework_dev'
Btw is there a way to reset a specific applications configuration? So that you can step through it again in your web browser?
If you cant access with
/Applications/MAMP/Library/bin/mysql -uUSERNAME -pPASSWORD DATABASENAME
there is no way you can access your database via PHP/Akelos unless you provide valid credentials
Ahh i didn't get the -u and -p part. When i added that I was enable to connect.
AlfredMacBookPro:~/akelos_framework alfner$ /Applications/MAMP/Library/bin/mysql -uroot -proot akelos_framework_dev
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 109
Server version: 5.0.41 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
I tried to move inside the application folder and run the command but it didn't make any difference:
AlfredMacBookPro:~/akelos_framework/peakhour alfner$ ./script/migrate Peakhour install
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in
/Users/alfner/akelos_framework/vendor/adodb/drivers/adodb-mysql.inc.php on line 349
Connection to the database failed. mysqlt://root:******@/peakhour_dev?socket=/Applications/MAMP/tmp/mysql/mysql.sock
But it's interesting that it first says "/var/mysql/mysql.sock" and then "/tmp/mysql/mysql.sock". Could that have anything to do with it not working?
Can you connect to the database using other DB's like phpMyAdmin?
What do you get with
ls -al /var/mysql/mysql.soc*
it should be something like
/var/mysql/mysql.sock -> /Applications/MAMP/tmp/mysql/mysql.sock
BTW are you using a "+" or "@" in your password?
Nope I don't get that "connection". How do I set that up?
AlfredMacBookPro:~/akelos_framework/peakhour alfner$ ls -al /var/mysql/mysql.soc*
ls: /var/mysql/mysql.soc*: No such file or directory
Nope my password is simply root on my development machine.
Try with
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
Hmm, I get an error:
AlfredMacBookPro:~/akelos_framework/peakhour alfner$ sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password:
ln: /var/mysql/mysql.sock: No such file or directory'
Do I have to specify further where the /var/ folder is?
/var/mysql/ should already exist in order to add a symlink inside that path
Cool, now it works! Here's how I did it:
Thanks a lot for all the help!
Maybe this helps ? : http://wiki.akelos.org/booklink-quickstart-on-windows
I am using Akelos with MAMP on a Mac as well. But I get stuck with the setup of the databases, when following the instructions in the "Getting Started Tutorial". There it is stated, that for the DB-setup the following command should be executed:
./script/configure -i
Now this somehow does not work with my MAMP setup. I have MySQL running on Port 8889.
I do can access the database within Terminal - but during the Akelos DB-Setup, I receive the error "Could not connect to the database".
I tried to setup the Databases by hand (as described in the Booklink Tutorial) but no luck either. I assume, that Akelos does not get that I run the MAMP MySQL Server on Port 8889?
Thanks for your help.
Oliver
Did you set your 'port' option in config/database.yml file?
Did you set your 'port' option in config/database.yml file?
The following workaround solved this issue for me (OS X 10.6 with MAMP v1.9):
I updated the Wiki-Post for OS X accordinginly: Setting Up Akelos On Os X Snow Leopard#Hint
1 to 29 of 29