Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




PHP + MySQL On Apache2


I just made a server out of one of my old computers. I installed Apache2 and the latest versions of PHP and MySQL. Now, the server is working great, I can run PHP scripts like I want and I can use shell access to connect to the database. I even managed to create a new database.

BUT, when I try to use PHP to connect to my database everything doesn't work so good anymore. I tried to install phpMyAdmin but that complained before I even got to the settings. Now I'm trying to install phpBB 2, something I've installed many times before on other servers. When I run the install script I get "The PHP configuration on your server doesn't support the database type that you chose".

I've found a few things about this here and there but nothing I've tried so far has worked out.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Local MySQL DB With PHP And Apache2
this is the environment:

Windows XP Professional V2002 SP2
Apache Server 2.0.54
PHP 5.0.5
MySQL 4.0.21.

All applications are working as such (Apache, PHP and MySQL DB), but when I try to connect to the DB, nothing happens (not even an error). I was reading around a bit and tried some stuff. Eventually I found some things I haven't done):

####
went into php.ini and inserted the path of the apache document root path into the doc_root field
in addition inserted the extensions dir path to the extension_dir field in php.ini, which was c:phpext

scrolled down to almost the bottom of the php.ini file and deleted the 'comment' character to activate the php_mysql.dll extension.
###

Now, I did this, but when I restart the Apache Server I get two error messages:

PHP Startup: Unable to load dynamic library 'C:phpextphp_mysql.dll' - The specified module could not be found.

This does not make sense, because the dll IS in that folder. I even reinstalled PHP and reconfigured the ini-File. Nothing. And it really, really, REALLY am getting annoyed here (yes, I tried forward slashes).

MySQL Running In Linux With Apache2
I have Fedora Linux running on my box. I have installed Apache2, PHP, MySQL. I used YUM to install everything.

yum install httpd

yum install php

yum install mysql-server mysql

yum instal php-mysql

What I want to know is that how can I start playing around with all this cool programs. I want to learn as much about all these awesome programs. I would like to install some kind of control center for MySQL. I heard MyPHPadmin is good. But how do I install it?
Can I do it through yum? Where can I find a good newbie guide?

thanks in advance :-)

Fedora Project
Information is Power!
I am doing this for the love of MySQL.

Unable To Access MySQL From Apache2+PHP4
this is the first time I (try) to set up my own webserver. Installing/configuring Apache2 went fairly well with some help, and PHP4 too. But the problem now is that I don't really know how to use MySQL. I mean, I know some easy SQL stuff, but I don't know much about installing such a server program.

I've searched the forums, and found this post.

Well, I got a page in the htdocs dir which shows a listing of PHP statistics (with the phpinfo() command). I've added a screenshot of the MySQL stats which this page shows, with this post.

So then I tried the following step which Mr. Oshikorosu explained, I copied his script and put it in a file. However, I already have a password setup for my root account, so I changed this: $password="mypassword";.

Then when I accessed that page, I got this error: Error 1045: Access denied for user 'ODBC'@'localhost' (using password: NO).

What did I do wrong and what do I have to do to be able to use the MySQL function with PHP4? I tried reading this doc from the PHP Manual, but I don't really understand it and also, the php.ini file says that my version on windows automatically supports MySQL ??

I'm running all these progs on Windows XP Pro btw.

Mysql5 Setup Php5, Apache2
Trying to setup mysql5 to run with apache 2 and php5 and having very little luck. I've followed instructions from many sites and yet it still isn't being recognised when using the php functions to connect to the db.

mysql runs fine on it's own as I've been using it. I've downloaded the *.dlls from mysql and installed them in the correct dir's, uncommented the mysql dll in php.ini and restarted apache.

Installing Mysql5 (winXP, Apache2, Php5)
Using window XP.

I install Apache_2.0.55, PHP 5.1.2 installer.
After testing, server can run with php codes properly.

However,
How to install mysql5 and combine with Apache3+php5??
Where should i choose for install path way??
Should i choose C:Apache2 ???

I decide to install mysql-essential-5.0.18-win32.msi and the path way is C:mysql

finish installation.....

How can i start mysql5??? directly double-click mysql.exe => a "bee" sound heard and the file self -close immediately. I try to click other exe diles and all of them self-close immediately. Code:

ERROR 2002 (HY000): Can't Connect To Local MySQL Server Through Socket '/var/lib/mysql/mysql.sock' (13)
I have a problem connecting to sql and can't find anything on the net to solve the problem.

I have some sql databases running on a server. when I'm root on the server and I want to login to sql I do "mysql -ustudent -p -Dwordnet30 and it works fine. when I'm logged in with the user account on the server, i get this error message:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

so with the same user name in mysql, i can log on when i'm root, but not when i'm the user. the grant table for the user looks like this: Code:

Can't Connect To Local MySQL Server Through Socket '/home/data/mysql/mysql.sock' (13)
I just installed mysql on linux. If I open a terminal, su to root,
then type "mysql", I am able to connect to the server and run my
queries.

If I exit out of su so that I am my own id (baisley) and type "mysql",
I get this error: Can't connect to local MySQL server through socket
'/home/data/mysql/mysql.sock' (13)

Any idea why? mysql.sock has full permissions (read/write/execute), so
it should be accessable by user baisley. If I am baisley and I run
"mysql -u mysql" (as mysql is the user that the RPM set up), it will
connect.

What I would like to be able to do is run this without having to be
user mysql all the time. How do I go about setting that up, or is it
better to run all my queries/make tables as 1 user?

ERROR [HY000][MySQL][MyODBC 5.00.11][MySQL] 2006 MySQL Server Has Gone Away
Hosting Package Environment:
ASP.NET ver 2
MySQL 5.0
FP Extensions 2003

Progression:
Developed Website Outline
Developed Database in Access2003
Migrated AccessDB to MySQL @ Hosting Service using Migration Tool.
Can connect using MySQL Admin tools and run queries fine and all data, relations etc. are there.

PROBLEM: (The heart of the matter)
Starting simple, created GridView Control using Microsoft Visual Web Developer 2005 Express, a few glitches here and there, used the MySQL Connector/ODBC v5.00.11 followed instructions. Can see database in Database Connections Window but when I try to connect the GridView Control to it I get:

"Database schema could not be retrieved for this connection. Please make sure the connection settings are correct and that the database is online.

ERROR [HY000][MySQL][MyODBC 5.00.11][MySQL] 2006 MySQL server has gone away"

Had thought that "Microsoft Visual Web Developer 2005 Express" might be messing with the ODBC driver so thought to download the .NET Connector. That's when it all went bad. The documentation does not say how to install or use the connector or where to put the files. It seems to assume that these bits of information are common knowledge and I suppose that if I had kept up with the technology it might be. But alas I didn't and it Isn't and It Don't work.

Warning: Mysql() [function.mysql]: Access Denied For User 'apache'@'localhost' (using
my script is not connecting to my database, i get this error

Warning: mysql() [function.mysql]: Access denied for user 'apache'@'localhost' (using password: NO)

Warning: Mysql_query(): Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)
I'm trying to connect to my MySQL database (sitehosted by GoDaddy) using PHP. I am having these errors and don't understand what they mean

Warning: mysql_query(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/content/n/l/a/nladmin/html/v5.0_3/c_register.php on line 6
Warning: mysql_query(): A link to the server could not be established in /home/content/n/l/a/nladmin/html/v5.0_3/c_register.php on line 6

Notice: Query: SELECT * FROM types MySQL error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/content/n/l/a/nladmin/html/v5.0_3/c_register.php on line 6
here4
Warning: mysql_close(): no MySQL-Link resource supplied in /home/content/n/l/a/nladmin/html/v5.0_3/c_register.php on line 13

I've checked paths and connection settings and don't see any problems. My guess is now that the problem is coming from the opening and closing of the DB. my script, c_register.php uses a require_once('../mysql_connect.php') to open the connection to the database. But I also have a function definition in c_register.php that uses require_once('../mysql_connect.php') when called because it needs a connection to the DB. Here's a visual that might help:

MySQL Error Number 2003 :: Can't Connnect To MySQL Server On 'hostname'(10065)
I was running an older version of the query browser a while back to connect to an older version of mySQL (3.0) running on a linux box. The server hasn't changed, but the query browser has been upgraded to 1.1.10. I can't go back to the older version of the query browser because the machine that ran it got re-formatted so I downloaded the new version and installed it.

So ... I get the following error when I try to connect:

MySQL Error Number 2003
Can't connnect to MySQL server on 'hostname'(10065)

Interestingly, I wrote a simple PHP script to connect to the server and pull some data off of it:

How To Configure MySQL ODBC Driver To Connect To A Mysql Server On My Own Side Of The Router?
Using MS Access, I have attached to MySQL servers in other states
and other countries on the other side of my router. But when I use the
MySQL ODBC driver 3.51 to connect to a MySQL server on my own LAN,
the driver tells me it cannot make the connection. Here are the ODBC
driver connection parms:

Data Source Name: (free field - name my "my linux box" will do nicely)
Host/Server Name (or IP) - something like MSQLUserName@ServerName.net
has worked fine for me in the past. Now I'm trying 192.168.1.106
Database Name - whatever, mysqldb works fine, any valid db

User - root
Password - myrootpass

Port - 3306 has worked fine 4 me N the past. Dunno whether 2 use now
SQL Command On Connect - haven't ever put anything here

Perhaps there is some configuration in mysql user privilege for the
mysqluser "root" that would prevent him from logging from a remote PC
to the mysql server?

MySQL Error 2013: Lost Connection To MySQL Server During Query
I'm running sugarcrm on mysql and the following query is returning "MySQL error 2013: Lost connection to MySQL server during query":

Table Rows Inserted By Embeddded MySQL Cannot Be Retrieved By MySQL Tcp Client
I have encountered a weird behavoir of embedded MySQL. Through a
simple program I made (in Delphi 6), I can insert rows to a table
through embedded MySQL and I can retrieve the rows from my program.

But using mysql.exe which points to the same table (through 127.0.0.1,
with the same basedir and datadir), I cannot see the rows I inserted
using my embedded program. Another way around, the rows inserted by
mysql.exe can be seen in my embedded program. But after a row is
inserted by mysql.exe, the rows inserted by the embedde program are
deleted (or cannot be queried).

Can anybody explain why is this? Is there a way to fix it?

Download Of Mysql.sock File Unable To Connect To Mysql Server
Where can i get the download mysql.sock file?

I am unable to connect to local server because i dont have this file?

ERROR 2002 (HY000): Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)
I want to user ports to install phpBB
But I found that phpBB doesn't support mysql 5.x (but the ports
installed mySQL 5.0.0 alpha)

so I deinstall mysql5-server and mysql5-client
And then I install mysql41-server and mysql41-client on FreeBSD 5.3 by
ports but now , mysql is not workable Code:

Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)
I have this error whe I'm trying to connect MySQL from PHP. But I can connect with Query Browser or some other software.
Why I get this error? How can I fix this?

Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (46)
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (46)

I get this error when I try to communicate with a table I made using a text file ...

I Want To Make Transfer Data Between MySQL Server To MySQL Local .
I want to make transfer data between MySQL Server to MySQL Local .

My Environment.

Server < --- > My PC Client

Server =
::::: MySQL DB Server ( for Linux )
::::: Apache ..
::::: Linux

PC Client =
::::: Window
::::: MySQL run localhost ( for window )

How i transfer data from mysql server to mysql local .?
Caz i don't want to connect via 3306 port ..
Can i use others way?

Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)
I am using a Mac running Mac OS X 10.4.8 and I have successfully installed MySQL on it but when I go to run it using the command

sudo ./bin/mysqld_safe &

all it does is display a random dumber and when I try the command

./bin/mysqlshow -u root -p

I get an error message saying

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Mac OS 10.3 -- Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock'
I just downloaded & installed MYSQL. It seemed to work and I can start
it and enter my password and change a directory but that is about all.
I have been ready and playing "hit & miss" all afternoon and it seems
to have something to do with the "mysql_install_db" not being
installed correctly -- I have tried multiple installs with multiple
downloaws.

My log. . .

MySQL Variables, Modifying Microsoft SQL Sequence Insert For Use In Mysql
I have the following microsoft SQL statement that inserts 25 new
records in sequence. However I am trying to modify this to work in
MySQL.

I cant seem to get the variable decleration right. I tried using
DECLARE CurVal int but that generates a mysql error. How can I modify
the code below to work under mysql? Code:

Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock'
I've installed MySQL-4.0.14 under RedHat 8, using both rpm's and compiling
from source. When I try to run MySQL, I get the following error: Can't
connect to local MySQL server through socket '/tmp/mysql.sock'

After much searching on Google, and reading many newsgroup threads on this
error, as well as reading the manual, I'm still stumped. Most of the
advice I've found suggests that the path to mysql.sock is wrong, which
makes sense, but I don't have the file mysql.sock anywhere on my machine,
so obviously I can't correct the path.

Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)
I just got mysql 5, from mysql 3 or 4 (can't remember it's been so long). I can't seem to get a connection. I searched and found http://dev.mysql.com/doc/refman/5.0/en/unix-post-installation.html#starting-server

Here is what it says to do, I don't know enough to be able to follow. Please advise:

If you have problems starting the server, here are some things to try:

* Check the error log to see why the server does not start.
ME: How? Where?
* Specify any special options needed by the storage engines you are using.
* Make sure that the server knows where to find the data directory.
ME: How?
* Make sure that the server can access the data directory. The ownership and permissions of the data directory and its contents must be set such that the server can read and modify them.

MySQL-error : Can't Connect To Local Mysql Server Through Socket
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get
the following problem when connecting to mysql through a browser
(phpMyAdmin)::

#2002 Can't connect to local MySQL server through socket
/var/lib/mysql/mysql.sock

On the website of MySQL this error is mentioned but I found no solution.

In /var/log/messages the following log occurs :
localhost kernel: audit(....): avc: denied {write}for pid=2458
exe=/usr/sbin/httpd name=mysql.sock dev=hda13 ...

What I have tried :

- mysql.sock is srwxrwxrwx, seems ok, but dont know what the s stands for
- the dir /var/lib/mysql was drwxr-xr-x and I changed it to drwxrwxrwx : no
effect
- tried different version of phpMyAdmin : same error
- installed my website and got the following error : No connection possible
with database (in the next version I will improve the error-messages)
- through commandline there is no problem in connecting to mysql (log in,
create databases, inserts, deletes, uploading dumps, making dumps, ....)

What is the solution or what else can I try ?

No Mysql Pid File Found. Looked For /var/lib/mysql/localhost.localdomain.pid
The log of my system says:

"no mysql pid file found. looked for /var/lib/mysql/localhost.localdomain.pid"

how to deal with problem?

MySQL AB: MySQL - INSERT DELAYED, Wheres The Equivelent For UPDATE?
I'm having fun doing a large scale UPDATE on a database table. I found I can do an INSERT DELAYED to do bulk inserts without blocking the apache thread, but there doesn't seem to be an equivelent for updating.

Error With SQL Statement When Using MySQL 5.0.24 (Works Fine In MySQL 4.0)
Here is my query that worked in mySQL 4.0 but not in MySQL 5.0.24:

INSERT INTO magtallynew SET magempnum=?', magcentre='YVRRC', entrydate=&#55614;&#57158;-08-15', empnum=?', empcentre='YVRRC', connection='Rockwell', service='Express', region='dom', callertype='CSR', otherdept='', transferredcall='No', directrespdept='No', station='Not Applicable', withoutmagassist='Yes', category='Accounting', issue='Advised On Contact', comments='test'

Here is the error message I get:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'connection='Rockwell', service='Express', region='dom', callertype='CSR', otherd' at line 1

[MySQL][ODBC 3.51 Driver][mysqld-5.0.19-log]MySQL Server Has Gone Away
My site is hosted on Windows IIS, and I use ASP, and connect to MySQL 5.0.19 via an ODBC 3.51 driver.

MySQL is I think hosted on a Linux machine.

My problem is this:

My site keeps getting lots of these errors messages each day:

[MySQL][ODBC 3.51 Driver][mysqld-5.0.19-log]MySQL server has gone away

I mean hundreds - e.g. for Feb alone, so far, these errors have been logged in my error table:

How To Run MYSQL Script Like Mysql.sql From The Command Line In Windows
Can anyone tell me how to run a script from the command line in Windows?

I was able to create a database and would like to run the script to add the tables from the command line.

Remote Connection To MySQL DB Server From Client With No MySQL DB
I have MySQL server running on a Solaris machine. I have a Perl tool that is run on multiple operating systems (Linux, Solaris, MKS on windows, CYGWIN on windows). I would like to post to the MySQL database on the Solaris machine from this script when it is run on the different local clients. All these clients share a single network share (available via Samba on windows).

Is there a Perl module that I can install in the network share that I can use to connect remotely to the server DB?

MySql: Select Database And Perform Mysql Dump
I currently have a batch file created using shell which runs mysqldump and saves the information to a file. However, I was wondering if there would be a way to use a recordset instead to select the database and initiate the mysql dump.

Ideally this is what i would like to have:
rs.Open "Use database mysqldump  > C:", conn, 3, 3

Does anyone know if this is possible?

Connection Pool For Mysql And Object Oriented Mysql?
I am using apache, Object Oriented PHP and mysql. How do I do connection pooling with mysql? Also, I want to know if there is an easier way to interface object oriented php with mysql.

Mysql Can't Connect To Local MySQL Server Through Socket ...
does anybody know what exact problem mysql has when dieing by "mysql Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'"

i encountered this problem when working on a huge xml file (~8megs) and it totally stunned my mysql server. myadmin throws the same error message now (#2002 - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock')

any ideas? maybe it's just an adjustment to the my.ini ...

Can't Connect To Local MySQL Server Through Socket '/var/lib/mysql/mys
First of all, the mySQL server is running inside a Smoothwall firewall.  I am using a DMZ Pinhole to port 3306 from a webserver with public internet access, to the mySQL Mandrake 10.1 linux box inside the firewall on the internal LAN.

I am using mySQL v4.0.20

When I try to connect to the mySQL database, via HTTP only, from ANY other machine other than the mySQL server, I get the following error reported:-

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/cabstatus/connection.inc on line 7
Connect Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

I am using a PHP script to access the mySQL database:- Code:

How To Run A MySQL Database On Machine Without Installing MySQL Engine.
I need to run a db created in MySQL on a server I cannot install MySQL on. Is there any way how to solve this ? Please let me know the way how to make a rutime to make myself able to work with the given db on that machine.

Question Regarding MySQL Interface Options And MySQL Vs MS Access
First, there are many applications available for interacting with MySQL. One of the things that frustrated me at first was the CLI. I know that it's the foundation and understanding syntax is critical to making it all work in the end, but when dealing with large datasets, I feel that a GUI makes life easier at times.

So, I started out with phpMyAdmin, seems to be 'the' geek-preferred application. I also ran into a few shareware ones here and there as well as Navicat, and I recently learned that there are 2 apps from MySQL.com for administrating the DB and creating queries.

In your experience, what seems to be the best MySQL interface application? At the moment I couldn't say *exactly* what I'm looking for, but more-or-less something that will ease the headache of creating queries and managing users, tables, etc.

Question #2:

I have been hired to be a Web Developer, Network Admin, and Database Administrator all-in-one. We have are a retail company selling peuter goods and have a product line-up of about 100 items. The President wants a robust database to deal with everything. Right now we use MS Excel for our needs. He says it's becoming cumbersome and wants to move on. I suggested MS Access because that's exactly what it's built for, companies that have been running in Excel and want more robust control over what they're doing. But the president keeps hearing this 'MySQL' buzzword and wants a MySQL database. Fine with me, I just know Access better, that's all.

I've been cramming PHP & MySQL down as fast as I can and am starting to feel more familiar with both technologies. At the moment, I feel MySQL to be more of a headache (my fault I'm sure, I just don't know it yet) But For Example:

To properly normalize a DB, I sometimes have to break a table into 3 tables. The first and second are no problem, but the third 'association' table is annoying (at least doing it CLI or phpMyAdmin). See, Access, you just make 2 tables and graphically set associations very easily.

So, from what you know of MySQL, do you think it would be still superior to Access seeing as we want to integrate it into osCommerce eventually and possibly some of their user contributions?

Using MySQL 3.23 Driver With MySQL 4 (and Borland DbExpress Drivers)
I've been playing with the Borland dbExpress Drivers, and it would appear
that Borland only have beta drivers for MySQL 4.x.x

However it would also appear to be possible to access a MySQL v 4.x.x
database using the 3.23 client libraries (i.e just get libmysql.dll from
3.23) can here see any problems in doing this?

The only ones I can see is we'll loose some features such as the ability to
use encrypted SSL connections.

Import Dump From Unix Mysql To Windows Mysql
I am trying to load a dump from a MySQL database on my ISP's server to my development environment on a Win 2K machine (running MySQL). When I run the mysql command to run the load script, MySQL gives the following complaint:

"ERROR 1064 at line 21: You have an error in your SQL syntax. Check the manual t
hat corresponds to your MySQL server version for the right syntax to use near 'D
EFAULT CHARSET=latin1' at line 7"

The dump from the ISP's server is created using mysqldump. The ISP is running MySQL 4.1.20. My development environment is MySQL 4.0.26. I have no problem loading dumps made from my development environment usng phpmyadmin.

Migrating Data From MySql(Windows) To Mysql (Solaris)
I am running mySql 5.0 on windows and i plan to migrate to Solaris, i have install the MySql 5 on solaris 10. Please how do i transfer all my Data, and i was wondering if there is a Data File That includes all my data that i can just copy over to the new system.

Restore Mysql Databases From /var/lib/mysql/user_database/ Files Only?
I recently had a harddrive failure and luckliy I can still access certain directories on this failed drive. I can still access the /var/lib/mysql/ directory which holds all the users databases and have backed all these up separately using tar.

Now what I need to know is how do you restore these database files to another server? I tried simply untar'ing one of these to the new servers /var/lib/mysql/ direcotry and it stuffed Mysql up - it went offline. I had to get a cpanel tech to bring Mysql back online.

Another JOIN Problem After MySQL 3 -> MySQL 5 Upgrade
I have inherited a query that works perfectly on MySQL 3/4 but not 5. I didn't write it and very little experience with joins.

So my first question is... what's it trying to do and the second question is... why isn't it working?

The exact error message is:

Quote:

Unknown column 'u.user_status' in 'on clause'

SELECT
u.user_id
,u.user_username
,u.user_status
,u.user_display_name
,s.user_status_name
,u.user_default_email
,u.user_accepted_regions
,u.user_hotel
,u.user_FROM
user u
,user_ticket t
LEFT
JOIN
user_status s
ON s.user_status_id = u.user_status
LEFT
JOIN
user_plan p
ON p.user_plan_id = u.user_hotelier_plan
WHERE
u.user_id = t.user_ticket_user
AND u.user_id > 0
AND t.user_ticket_ref=".$strTicketRef."
AND (" . time() . " BETWEEN t.user_ticket_created AND t.user_ticket_stale)

Different Results In Mysql & Mysql Query Browser?
I've come across an extremely strange problem. The exact same query in
both mysql command line client, and mysql query browser gives entirely
different results. I was hoping someone out there could shed some
light.

Ok, the query (I've stripped it bare, the real query is a bit more
complex)...

Each person in the people table has an associated 'place', which is an
integer that maps onto a suburb in the suburbs table. The 'place' CAN
be NULL.

so, for all intensive purposes, the schema is roughly:

MySQL AB: MySQL - Use A Out Parameter In An Insert Into Statement
I have a stored procedure that inserts a new passenger into a database. The fields are name and email. The passengerID is a auto increment. The database I am using is mySQL.

The problem is that I want to return the passengerID when the stored procedure is called. I am not sure if that is possible. Here is my code:

Store procedure in mysql
CODEDELIMITER $$

DROP PROCEDURE IF EXISTS `flightdb`.`spInsertNewPassenger`$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `spInsertNewPassenger`(_name varchar(50), _email varchar(5) )
BEGIN
    INSERT INTO Passengers ( name, email )
    VALUES ( _name, _email );    
END$$

DELIMITER ;

MySql Problem With Unicode, MySql Connector/Net And C#
I have a problem regarding unicode characters and MySql.
I am using MySql 4.1 and MySql Connector/NET together with
C#.

My question is whether I' am making a silly mistake (or not),
by not being able to store unicode characters in a simple table.

The database I have created is supposed to be in unicode:
'CREATE DATABASE test CHARACTER SET utf8'.

Now, connecting from C#, i am trying to write into a simple
table, with one column, the value 'u0120u0121u0125u0411'
but when I am retrieving the value from the table, '????' is
returned as a result.

I don't know if its relevant, but i have checked that the
server and connection are using unicode encoding:

SHOW VARIABLES LIKE 'character_set_server' which returns
'utf8' as a result.

also:
SHOW VARIABLES LIKE 'character_set_connection' returns
'utf8' as a result.

Connecting To A Mysql Database Without The Mysql Server
Is it possible for me to copy a MySQL database to my pc (windows xp pro sp2) and use MySQL query browser to get records and create reports? If so, how do I make the connection?

Execute Mysql Command On Mysql 4.1 On Linux
I setup Mysql 4.1 on a linux box. But when I type 'mysq', I get this following error:
# mysql

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

even if I specify user name and password, like this mysql --user=root --password=
but that still does not work.

I was able to connect to that server using MSQL administrator with 'root' and no password. But when I telnet to that box and type 'mysql' and the xterm, I get this 'access denied' message.

Transfer Web MYSQL Entries To Local Mysql
I've got this online mysql database that stores form entries. I wanna transfer any new entries it receives to a local sql database on a computer. I heard that SOAP might be the way to do this, though i'm not very familiar with it and tutorials can be confusing. Any advice, is this easy or difficult?

How To Detect If A MySQL Db Table Exists In MySQL 4.1+
$sql = "SELECT IF((SHOW TABLES LIKE '$subselectTableName'), count(*),
NULL) AS numRows FROM $subselectTableName";

I am trying to write a SQL statement that will tell me if a table
exists or not, this is because PHP will throw Fatal Errors and halt all
programming if the table does not exist that I attempt to query.

How do you write an elegant MySQL 4.1+ statement to detect if a table
exists or not?


Copyright © 2005-08 www.BigResource.com, All rights reserved