Port 3306 restricted to IP addresses
For the inbound connection on port 3306 of MySQL Server, how do I restrict the connection to some IP addresses something like 1.2.3.* What do I need to do in my.cnf file? Thanks in advance. NOBBY - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Why queries only the first SELECT statement
Hi list, I am trying to making online telephone directory search. I have an input form which has input for name and SELECT option for the area. Name of this form file is 'searchtel.php' This form parsing is done by 'searchtelparse.php' file which has query, i.e $query with 'IF' statement for different areas. When I execute SEARCH on the form, it only queries from the first 'SELECTED' option's area table i.e the default option. I have a separate table of telephone numbers for each area. Even though I select another area, it will give query from the default SELECT option. Both the files 'searchtel.php' and 'searchtelparse.php' are pasted below for you reference. Could you please have look and suggest me some corrections. Thanks in advance. NOBBY searchtel.php FORM method=post action=searchtelparse.php name=searchtel input type=text name=Name size=20 maxlength=63 Select location: select name=location option selectedGasa/option optionPunakha/option optionThimphu/option optionWangdue/option /select input type=submit name=Search /FORM --- searchtelparse.php ? error_reporting ( ~E_ALL ~E_NOTICE ); /* connection information */ $hostname = localhost; $username = root; $password = root; $dbName = penpal; /* make connection to database */ MYSQL_CONNECT($hostname, $username, $password) OR DIE( Unable to connect to database); @mysql_select_db($dbName) or die( Unable to select database); if ($idnum == ) {$idnum = '%';} if ($Phone == ) {$Phone = '%';} if ($Name == ) {$Name = '%';} if ($Add1 == ) {$Add1 = '%';} if ($Add2 == ) {$Add2 == '%';} if ($Add3 == ) {$Add3 == '%';} if ($Type == ) {$Type == '%';} if ($location =Gasa) { $query = (SELECT * FROM gasa WHERE Name like '%$Name%'); } elseif ($location =Punakha) { $query = (SELECT * FROM punakha WHERE Name like '%$Name%'); } elseif ($location =Thimphu) { $query = (SELECT * FROM thimphu WHERE Name like '%$Name%'); } else { $query = (SELECT * FROM wangdue WHERE Name like '%$Name%'); } echo $location; $result = MYSQL_QUERY($query); if (!$result) print (No matches found.\n); /* Determine the number of records returned */ WHILE ($row=MYSQL_FETCH_ROW($result)) $number = mysql_numrows($result); if (!$number) print(font face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\bThere are matches found./b/fontp\n); /* Print the relevant information */ $i = 0; PRINT table cellpadding=5; PRINT TR bgcolor=#66 tdfont face=\Verdana, Arial,Helvetica, sans-serif\ size=\-2\ color=whitebidnum /b/font/td tdfont face=\Verdana, Arial,Helvetica, sans-serif\ size=\-2\ color=whitebPhone /b/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ color=whitebName /b/font/tdtdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ color=whitebAdd1/b/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ color=whitebAdd2/b/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ color=whitebAdd3/b/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ color=whitebType/b/font/td /tr; WHILE ($i $number): $idnum = mysql_result($result, $i,idnum); $Phone = mysql_result($result, $i,Phone); $Name = mysql_result($result,$i,Name); $Add1 = mysql_result($result,$i,Add1); $Add2 = mysql_result($result,$i,Add2); $Add3 = mysql_result($result,$i,Add3); $Type = mysql_result($result,$i,Type); if ($i%2 == 0) { PRINT tr bgcolor=#E8E8E8 tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $idnum/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $Phone/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $Name/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $Add1/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $Add2/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $Add3/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $Type/font/td /tr; } else { PRINT tr bgcolor=#cc tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $idnum/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $Phone/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $Name/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $Add1/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $Add2/font/td tdfont face=\Verdana, Arial, Helvetica, sans-serif\ size=\-2\ $Add3/font/td tdfont
Re: adding a user to a database
You should specify the machine address after @ something like 'localhost' or specify particular IP / name. I might do this. grant all on db.bsd to shadowgrl@localhost identified by testing123 with grant option; When you connect remotely, you need to specify host name. NOBBY - Original Message - From: Michael Sharp [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, March 09, 2002 6:07 PM Subject: adding a user to a database I'm using MySQL 3.23 on FreeBSD 4.5-STABLE, and I am kinda new to MySQL. I created the database bsd as root. I need a remote user, connecting from any IP and logging in with shadowgrl and giving the password testing123 to have full access to the bsd database only. After making the bsd database, I did this: grant all on db.bsd to shadowgrl@ identified by testing123 with grant option; I know the last option is dangerous, but I trust this user fully, and the server is firewalled to only allow her network in. However, when connecting remotely, shadowgrl is getting error: user has no access to server What am I overlooking? Michael - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: ....from ms access to mysql
Someone in the list posted the following links. I went with the second one and it worked. NOBBY http://www.convert-in.com/acc2sqlp.htm http://ultradev.buzzinet.co.uk/mysql/tutorials/converting_data/index.asp http://www.winmysql.com/ - Original Message - From: Fabio Amura [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 1:33 PM Subject: from ms access to mysql Hi, i have to migrate from ms access to my sql, and i dont know how can i do... do your know at easy metod for this migration, and can you give me indication or link i'm not an espert... thanks fabio -Messaggio originale- Da: Jochen Kaechelin [mailto:[EMAIL PROTECTED]] Inviato: giovedì 14 febbraio 2002 7.52 A: [EMAIL PROTECTED] Oggetto: Updating SuSE 7.3 Can I use the RedHat-rpms on mysql.com to update a SuSE 7.3 prof or do I need to compile it from source with some parameters? I run 3.23.44 max and I want to update to 3.23.48 max -- Jochen - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
SELECT query with TRIM and LIKE
Dear list, I have a telephone database which has Name as one of the fields/columns. This field contains single name e.g Robert, double names e.g Robert Downing and more than double names. I want to make a SELECT query using a form whose input name is Name i.e '$Name' against the Name field in the database. One can type a part/full of one part of the name, or part/full of two parts of a name and goes on likewise for more than double names in the input form. I believe this SELECT query is accomplished using TRIM and LIKE, something like: $query = (SELECT * from table_name where Name like '% Trim($Name) %' ); This $query is not working. Could sombody please provide me a query statement that I could use for my above requirement. Thank you so much. NOBBY - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: SELECT query with TRIM and LIKE
Thanks Nathan, I think I will go with SELECT * FROM table_name WHERE Name LIKE '%$name%'; NOBBY - Original Message - From: Nathan Bank [EMAIL PROTECTED] To: Tshering Norbu [EMAIL PROTECTED] Sent: Friday, February 08, 2002 12:25 PM Subject: Re: SELECT query with TRIM and LIKE What is the point of the trim? Why can't you simply SELECT * FROM table_name WHERE Name LIKE '%$name%'; Then, if the user types Rob, they'll get Robert, Robert Downing, etc. If they type in Robert D, they'll get Robert Downing. If you trimmed Robert D into RobertD with the trim() function, you would not match Robert Downing any longer. Is that different from what you want? By the way, if your 's are meant to join that info together, as it appears, you need to change them to .'s. A dot joins things. is a bit-wise comparison... Also, $query is a variable, not a function. Either lose the parens (), or add a function to the beginning, like so: $query = mysql_query(SELECT * FROM table); Hope that helps, # Nathan - Original Message - From: Tshering Norbu [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 05, 2002 10:29 PM Subject: SELECT query with TRIM and LIKE Dear list, I have a telephone database which has Name as one of the fields/columns. This field contains single name e.g Robert, double names e.g Robert Downing and more than double names. I want to make a SELECT query using a form whose input name is Name i.e '$Name' against the Name field in the database. One can type a part/full of one part of the name, or part/full of two parts of a name and goes on likewise for more than double names in the input form. I believe this SELECT query is accomplished using TRIM and LIKE, something like: $query = (SELECT * from table_name where Name like '% Trim($Name) %' ); This $query is not working. Could sombody please provide me a query statement that I could use for my above requirement. Thank you so much. NOBBY - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
SELECT query with TRIM and LIKE
Dear list, I have a telephone database which has Name as one of the fields/columns. This field contains single name e.g Robert, double names e.g Robert Downing and more than double names. I want to make a SELECT query using a form whose input name is Name i.e '$Name' against the Name field in the database. One can type a part/full of one part of the name, or part/full of two parts of a name and goes on likewise for more than double names in the input form. I believe this SELECT query is accomplished using TRIM and LIKE, something like: $query = (SELECT * from table_name where Name like '% Trim($Name) %' ); This $query is not working. Could sombody please provide me a query statement that I could use for my above requirement. Thank you so much. NOBBY - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Suppress WARNING
Tshering NORBU Webmaster DrukNet Bhutan Telecom PO Box 134 Thimphu, BHUTAN Email: [EMAIL PROTECTED] [EMAIL PROTECTED] Phone: Work: +975-2-326997 Home: Only on request - Original Message - From: [EMAIL PROTECTED] To: Tshering Norbu [EMAIL PROTECTED] Sent: Wednesday, January 30, 2002 9:40 AM Subject: Re: Suppress WARNING Your message cannot be posted because it appears to be either spam or simply off topic to our filter. To bypass the filter you must include one of the following words in your message: database,sql,query,table If you just reply to this message, and include the entire text of it in the reply, your reply will go through. However, you should first review the text of the message to make sure it has something to do with MySQL. Just typing the word MySQL once will be sufficient, for example. You have written the following: Hi list, How do you suppress the WARNING message like the one here: Warning: stat failed for photos/p73n1.jpg (errno=2 - No such file or directory) in /ad/details.php on line 12 Everything works fine even with that error. I wanted to suppress this error and not display at all. Regards, NOBBY - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Cannot Access mysql database
Do you have a root user? I had similar problem and set new password: $shell /usr/local/mysql/bin/mysqladmin -u root -h localhost -p password 'newpassword' Then I could get access to all databases using: $shell /usr/local/mysql/bin/mysql -u root -h localhost -p'newpassword' Of course, the paths in the above depends on your installation. I am on Linux 7.1 + Apache. NOBBY - Original Message - From: PHP Nut [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 01, 2001 10:33 AM Subject: Cannot Access mysql database Ok here is the short version of the problem. Installed mySQL database on Cobalt server RAQ4 using Linux. Everything worked great. Now the mysql database that is created by default with user table etc...is empty!!! (Due to a user going in using PHPmyAdmin and changing the user and password within the user table.) There is nothing in the mySQL database and now I cannot access the mysql database due to there being an error with incorrect user and password! Well there isn't since the mysql database does not have a user grant table. The weird thing is that using PHPmyAdmin, I can manipulate the test database that is installed by default. We have tried to re-install the database and this did not work. We then tried the suggestions on this page: http://www.mysql.com/doc/D/e/Default_privileges.html And that did not work either. I then tried copying the sql commands for creating the user table etc, from another mySQL database located on a different server. This does not work either due to incorrect user and password. Can anyone help out?? I am in deep poop with this and need to find a solution to get this mySQL up and running again. Thank you for taking the time to read this and any suggestions. Michael - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Implementing NEXT n BACK page in query
Dear list, I would like to query on the first page only the last 50 records/rows (order by ID desc) in the following script file which uses MySQL, and I want to have NEXT page for the 50 rows earlier than last 50 queried and continue similarly. I think I can use JavaScript for BACK page to go back. Could you pl add for me the script to implement NEXT page or suggest me. There is LIMIT clause to use, but I only know to use it to limit to certain number of query/rows. Here is the script file: html body ?php $db = mysql_connect(localhost, root, root); mysql_select_db(penpal,$db); if ($id) $result = mysql_query(select * from penpal where id = $id,$db); $myrow = mysql_fetch_array($result); printf(bID:/b %s\nbr, $myrow[id]); printf(bName:/b %s\nbr, $myrow[name]); printf(bAge/Sex/Location:/b %s\nbr, $myrow[asl]); printf(bDescription:/b %s\nbr, $myrow[description]); printf(bEmail:/b %s\nbr, $myrow[email]); } else { $result = mysql_query(select * from penpal order by id desc, $db); if ($myrow = mysql_fetch_array($result)) { do { printf(a href = \%s?id=%s\%s %s/abr\n, $PHP_SELF, $myrow[id], $myrow[name], $myrow[asl]); } while ($myrow = mysql_fetch_array($result)); } else { echo Sorry, no records; } } ? /body /html Thank you in advance. NOBBY - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Win32 installation problem...
Here is a link that I used to install MySQL on my machine running Win98 http://www.net-language.com/workshops/Default.asp?workshop=21 NOBBY - Original Message - From: Jason Rackley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 21, 2001 6:13 PM Subject: Win32 installation problem... Hello, I am trying to install mysql on my Windows 98 box as a standalone. I would like to work on my computer only, testing, etc before sending stuff to my server; therefore I would like to have a version of mysql that runs independently on my win98 box, probably along with Apache once I get the mysql daemon to run. Here's what happened: I installed mysql, then went to the command line From C:\mysql\bin\ I entered mysqld I got this error: 010521 error Warning: listen( ) on TCP/IP failed with error 0 can't initialize Innodb as 'Innodb_datafile_path' is not set' I also tried mysqld --standalone from the same prompt and got the same error. I got the same version to run on my WINME laptop no problem, but not on my win98 box. Any ideas? Your help would be much appreciated. thanks in advance, jason - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php