Web Hosting Talk







View Full Version : MySQL is installed but the script can't detect MySQL??


certify
08-04-2001, 07:15 PM
You can take a look at the attachment build.zip

MySQL is installed in my server but I can't get the script to detect my MySQL server?? :confused:



Step 3 - mySQL driver check

mySQL driver was not found. Please download it from the URL in the README file.

[root@cheng adscycle]#


MySQL is definately installed in my server. the only way to call the MySQL command is go to this directory /usr/local/plesk/mysql/bin

also typing mysql will keep saying command not found.


[root@cheng bin]# mysql
bash: mysql: command not found
[root@cheng bin]#


The only way to get it working is this


[root@cheng bin]# ./mysql -uadmin -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19 to server version: 3.23.32

Type 'help;' or '\h' for help. Type '\c' to clear the buffer

mysql>


Can can i get build.cgi to detect my MySQL??

mikeknoxv
08-05-2001, 10:52 AM
I don't think that command even starts mysql.
Try ./safe_mysqld OR /usr/local/plesk/mysql/share/mysql/ ./mysql.server start.

certify
08-05-2001, 12:55 PM
I have found out the problem. All i need to do is installed that.

DBD::mSQL / DBD::mysql - mSQL and mysql drivers for the Perl5 Database Interface (DBI)

MorganW
08-19-2001, 09:55 AM
Hi,

I'm having the same problem as you Certify, however I don't understand how you resolved it.

Could you please explain a bit clearer how you solved the problem?

Thanks

huck
08-19-2001, 03:00 PM
To use PERL with MySQL you need the DBI for perl. The DBI is an abstraction layer that makes writing database calls for perl easy (easier). If you have a script that is using DBD, then you must install the perl DBI package.

Installing Perl Modules with CPAN
An easy way to install PERL modules is to use the built in perl module management utitlity. You can start the utility by using:
perl -MCPAN -e shell

If this is the first time using the CPAN interface, you will have to answer a few questions and select CPAN mirrors to use. Try to use a mirror that is near you -- this will help download speeds somewhat. You will then have a shell interface into the CPAN archive.

After firing up the CPAN utility, you can install the DBI by using:
install Bundle::DBI
Larger PERL modules use Bundles that contain a lot of smaller modules necessary to get particular things up and running, e.g. mysql. The install command will download, make and install the bundle for you. If this fails, then you can go to www.cpan.org and dowload the DBI or DBD modules that you require and install them manually.


RPMS
Now, if you are more familar with RPMs then you can get the mysql-perl rpm package and install it. A caveat about RPMs is that they sometimes put files in odd places -- or in places most scripts don't expect them to be. With mysql, you should be okay, but if the RPMS fail, then you will to use one of the methods above.

Starting MySQL
To use your perl scripts you will have to start the mysql daemon. There are numerous tutorials on the web about how to do this, so do a search and find a tutorial you like.



Snags...
A common problem with perl scripts is that they will complain that they cannot find the mysql.sock file. You need this file to run many perl scripts. You should put a my.cnf file into /etc with the configuration options for mysql. In this file, make sure the path to the mysql.sock file is correct. You can put mysql.sock anywhere you want, just make sure that the path is correctly set in the my.cnf file.

MorganW
08-19-2001, 03:26 PM
Thanks for that information.

Is it safe to run this CPAN without compromising my installation of Plesk 2?

Ta!