Couldn't locate driver named mysql‏

Installation and environment issues, mainly on 1.x but there's some 2.x here too.

Moderators: dwhittle, Ian

Couldn't locate driver named mysql‏

Postby Robertcs » Tue Oct 05, 2010 9:29 am

Hi all,

I'm following jobbet example. I'm now in day 3 and I'm trying to create database model. ORM generates correctly database model, insert's model and class model.

But when I try to run doctrine:insert-sql, I receive following message: "Couldn't locate driver named mysql‏".

Some info about my configuration:

- Server:
- is virtualized through VirtualBox, running an ubuntu server.
- LAMPP is running on the server and serving correctly (up to now) jobbet example
- Mysql is running correctly and jobeet database has been created

- Client
- My own PC
- It can ping correctly the server
- It has symfony client correctly installed (I'm developing in my own PC).
- I checked php.ini configuration file. It contains all mysql's lines uncommented (so, using mysql)

Any hint?

Thanks in advance
Robertcs
Junior Member
 
Posts: 8
Joined: Sun Sep 26, 2010 10:58 pm

Re: Couldn't locate driver named mysql‏

Postby maastermedia » Tue Oct 05, 2010 11:48 am

Check if you have pdo_mysql enabled.
User avatar
maastermedia
Senior Member
 
Posts: 196
Joined: Sat Aug 14, 2010 12:51 pm
Location: Slovenia

Re: Couldn't locate driver named mysql‏

Postby Robertcs » Tue Oct 05, 2010 4:03 pm

Must I check php.ini on my local copy?
Robertcs
Junior Member
 
Posts: 8
Joined: Sun Sep 26, 2010 10:58 pm

Re: Couldn't locate driver named mysql‏

Postby halfer » Tue Oct 05, 2010 5:07 pm

Depends where you're getting the error. If the server is on your PC, then it will be on there; if the server is on your virtual machine, it's in there.

[Submitted prematurely - trying again!]
halfer
Faithful Member
 
Posts: 10148
Joined: Mon Jan 30, 2006 1:16 pm
Location: West Midlands, UK

Re: Couldn't locate driver named mysql‏

Postby halfer » Tue Oct 05, 2010 5:10 pm

Reading your post again, I think you're running the server on the virtual machine. On that basis, the php.ini can be edited there.

On that basis, what is a "symfony client"? :o
halfer
Faithful Member
 
Posts: 10148
Joined: Mon Jan 30, 2006 1:16 pm
Location: West Midlands, UK

Re: Couldn't locate driver named mysql‏

Postby maastermedia » Tue Oct 05, 2010 5:16 pm

You can also check in your phpinfo() output if pdo_mysql is enabled.
User avatar
maastermedia
Senior Member
 
Posts: 196
Joined: Sat Aug 14, 2010 12:51 pm
Location: Slovenia

Re: Couldn't locate driver named mysql‏

Postby Robertcs » Tue Oct 05, 2010 5:41 pm

Hi all,


Thanks for your responses! ;)

What I mean is that the server is virtualized, but i'm generating all sentences in command line in my PC (I'm following the philosophy of developing in local and deploying in a server: I suppose that this way of doing should be correct).

For as far as I know, my pc has it's own php (in fact, all sentences of the kind "php symfony bla-bla-bla" are working fine, as I followed the tutorial), and my server also has it's own php (LAMPP installation).

regards!
Robertcs
Junior Member
 
Posts: 8
Joined: Sun Sep 26, 2010 10:58 pm

Re: Couldn't locate driver named mysql‏

Postby halfer » Wed Oct 06, 2010 12:02 am

Right, so to summarise, you're executing your commands on your PC, and running the web server on your VM. You'll need MySQL configured on both in that case: for your CLI in the first case, and for your web server in the second.

I would suggest that you simplify this, if the above synopsis is correct; have the web server on your PC as well, and worry about deployment later. AFAICT your VM is unnecessary, though there are some use cases where they are a good idea (such as developing a site on Windows that will only run on *nix servers).
halfer
Faithful Member
 
Posts: 10148
Joined: Mon Jan 30, 2006 1:16 pm
Location: West Midlands, UK

Re: Couldn't locate driver named mysql‏

Postby fegx » Tue Nov 30, 2010 7:51 pm

I had the same problem. It's happened after a format, just install php-dev and php-mysql.
Hope this helps
fegx
Junior Member
 
Posts: 1
Joined: Tue Nov 30, 2010 7:45 pm

Re: Couldn't locate driver named mysql‏

Postby med84 » Wed Dec 01, 2010 8:32 am

i have the same probleme :

Code: Select all
C:\wamp\www\DEV\ARYS_1.0>symfony doctrine:insert-sql
>> doctrine  creating tables

  Couldn't locate driver named mysql

C:\wamp\www\DEV\ARYS_1.0>


pdo & pdo_mysql is correctly enabled... please help.

thank you!
med84
Junior Member
 
Posts: 1
Joined: Wed Dec 01, 2010 7:32 am

Re: Couldn't locate driver named mysql‏

Postby halfer » Wed Dec 01, 2010 8:21 pm

How have you determined that PDO and pdo_mysql are enabled?

Running phpinfo() in a brower may not do this on your system. Try "php -i" at the command line, which will let you know how your PHP CLI is configured. The php.ini to which this pertains is also output with this command.
halfer
Faithful Member
 
Posts: 10148
Joined: Mon Jan 30, 2006 1:16 pm
Location: West Midlands, UK


Return to Installation and setup

Who is online

Users browsing this forum: No registered users and 2 guests