This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Day 3 - Cannot create DB from Bash

Discussion around this tutorial for symfony 1.2-1.4

Day 3 - Cannot create DB from Bash

by Jamie_1982 » Tue Apr 26, 2011 11:34 am

Hi,

I have just started working through the Jobeet project for Symfony and have ran into a problem.

I have just created the schema.yml file and I even copied and pasted it to ensure nothing was wrong. I then attempted to create the database in bash using the following command:

$ mysqladmin -uroot -p create jobeet

I get the response "-bash: mysqladmin: command not found"

I am using XAMPP with Apache & MySql on Mac OS X 10.6.7. I have read elsewhere about needing to enable the socket to be available globally but cannot find any help topics on this.

I have also checked my config by placing a file at http://www.jobeet.com.localhost/check_configuration.php and I get the following response.

********************************
* *
* symfony requirements check *
* *
********************************

php.ini used by PHP: /Applications/XAMPP/xamppfiles/etc/php.ini


** Mandatory requirements **

OK PHP version is at least 5.2.4 (5.3.1)

** Optional checks **

OK PDO is installed
OK PDO has some drivers installed: mysql, pgsql, sqlite, sqlite2
OK PHP-XML module is installed
OK XSL module is installed
OK The token_get_all() function is available
OK The mb_strlen() function is available
OK The iconv() function is available
OK The utf8_decode() is available
OK The posix_isatty() is available
[[WARNING]] A PHP accelerator is installed: FAILED
*** Install a PHP accelerator like APC (highly recommended) ***
OK php.ini has short_open_tag set to off
OK php.ini has magic_quotes_gpc set to off
OK php.ini has register_globals set to off
OK php.ini has session.auto_start set to off
OK PHP version is not 5.2.9

Can anyone offer any light on this? I have been searching for a couple hours and cannot get past it.

Thanks,
Jamie
Jamie_1982
Junior Member
 
Posts: 3
Joined: Tue Apr 26, 2011 11:24 am

Re: Day 3 - Cannot create DB from Bash

by VelvetMirror » Tue Apr 26, 2011 12:32 pm

There is no need to use the console in order to create the jobeet database.

If you have installed Xampp go to phpmyadmin and create there a database called jobeet.
User avatar
VelvetMirror
Senior Member
 
Posts: 123
Joined: Tue Apr 12, 2011 9:53 am

Re: Day 3 - Cannot create DB from Bash

by Jamie_1982 » Tue Apr 26, 2011 12:44 pm

Thanks for that.

I am keen to get this working though - do you have any suggestions as to how I could fix this?
Jamie_1982
Junior Member
 
Posts: 3
Joined: Tue Apr 26, 2011 11:24 am

Re: Day 3 - Cannot create DB from Bash

by VelvetMirror » Tue Apr 26, 2011 5:49 pm

Jamie_1982 wrote:Thanks for that.

I am keen to get this working though - do you have any suggestions as to how I could fix this?


I thought I just did that:

If you have installed Xampp go to phpmyadmin and create there a database called jobeet.


Also there is nothing wrong with your configuration, there is no need to install the PHP accelerator.
User avatar
VelvetMirror
Senior Member
 
Posts: 123
Joined: Tue Apr 12, 2011 9:53 am

Re: Day 3 - Cannot create DB from Bash

by Jamie_1982 » Wed Apr 27, 2011 7:02 am

Thanks for that. I appreciate that I can create a DB straight from phpmyadmin but I was keen to get this working via terminal.

I saw one of the big benefits of Symfony being the amount of control you can have from terminal.

Thanks.
J
Jamie_1982
Junior Member
 
Posts: 3
Joined: Tue Apr 26, 2011 11:24 am

Re: Day 3 - Cannot create DB from Bash

by VelvetMirror » Wed Apr 27, 2011 10:28 am

You will be using all the Symfony commands anyway.

Code: Select all
mysqladmin -uroot -p create jobeet


This is not a symfony command, it is a mysql command. It would work anyway if you have nothing about symfony in your computer.

I suppose that this command it's executed through a linux machine, and that's why it works.

If you would have a Windows machine you would also get an error saying "is not recognized as an internal or external command".
User avatar
VelvetMirror
Senior Member
 
Posts: 123
Joined: Tue Apr 12, 2011 9:53 am

Re: Day 3 - Cannot create DB from Bash

by Creaton » Tue Oct 25, 2011 12:13 pm

Is it possible to create an empty database with one line of command in bash? My newbie attempts have failed.
Creaton
Junior Member
 
Posts: 2
Joined: Mon Oct 24, 2011 8:41 am