MySQL password issue
Hi All, Today I ran into an interesting problem with my MySQL installation. I'll start off with the usual suspects: this is my development laptop running Windows 7 Ultimate 64-bit this is a fresh install, fully updated from Windows Update. I downloaded the Windows Installer version of MySQL which is MySQL 5.5.28 Community Server. I ran the setup choosing Developer install, made a root password, then created two users for Backup and Replication. The install completed successfully, and I was able to start MySQL Workbench logging in as root once. I made a user in Server Administration and then imported a .sql backup file. I then went to SQL Development to review the result of the restore. I wasn't able to view the imported tables, Workbench seemed stuck on Retrieving Tables. This database is driving a website I'm working on, and I was able to load the site in a browser on my laptop - again once. Next, I went to add another user, and then tried to import another .sql backup file. This time, when I clicked Start Import, Workbench prompted me to enter my root password again. Odd I thought, as I'd originally told Workbench to save the password in its vault. Unfortunately, Workbench won't accept the root password. I receive the following message in a popup window: Cannot Connect to Database Server Your connection attempt failed for user 'root' from your host to server at localhost:3306: Access denied for user 'root'@'localhost' (using password: YES) The MySQL Service is still running, I've tried stopping, starting, and just restarting the service. I've tried rebooting. All with the same result. What could have happened to this install to make MySQL no longer accept my password? I have already tried uninstalling via the MySQL Installer, confirming that C:\ProgramData\MySQL was removed, and then shutting Windows down completely before trying to re-install. The same result happens - I'm able to log in once, then several minutes later it will no longer accept a password. This is a fresh install again, so there's not a lot of pain in uninstalling and reinstalling. Any thoughts on why this is happening, or more importantly, how to correct the problem? TIA, -Tim
Re: MySQL password issue
Not sure how the .sql backup file would have done that, but it seems to be working now. I'll just step away slowly and carry on. Thanks for the help! On 10/25/2012 2:45 AM, Nitin Mehta wrote: Hi Tim, It looks like your '.sql backup file' has changed the password for root user and why it is persisting is perhaps you have data directory outside the install directory. How you correct the problem: Stop the service, start the service with option '--skip-grant-tables', login with root user and change the password from inside mysql. Hope that helps. -Original Message- From: Tim Thorburn [mailto:webmas...@athydro.com] Sent: Thursday, October 25, 2012 12:08 PM To: mysql@lists.mysql.com Subject: MySQL password issue Hi All, Today I ran into an interesting problem with my MySQL installation. I'll start off with the usual suspects: this is my development laptop running Windows 7 Ultimate 64-bit this is a fresh install, fully updated from Windows Update. I downloaded the Windows Installer version of MySQL which is MySQL 5.5.28 Community Server. I ran the setup choosing Developer install, made a root password, then created two users for Backup and Replication. The install completed successfully, and I was able to start MySQL Workbench logging in as root once. I made a user in Server Administration and then imported a .sql backup file. I then went to SQL Development to review the result of the restore. I wasn't able to view the imported tables, Workbench seemed stuck on Retrieving Tables. This database is driving a website I'm working on, and I was able to load the site in a browser on my laptop - again once. Next, I went to add another user, and then tried to import another .sql backup file. This time, when I clicked Start Import, Workbench prompted me to enter my root password again. Odd I thought, as I'd originally told Workbench to save the password in its vault. Unfortunately, Workbench won't accept the root password. I receive the following message in a popup window: Cannot Connect to Database Server Your connection attempt failed for user 'root' from your host to server at localhost:3306: Access denied for user 'root'@'localhost' (using password: YES) The MySQL Service is still running, I've tried stopping, starting, and just restarting the service. I've tried rebooting. All with the same result. What could have happened to this install to make MySQL no longer accept my password? I have already tried uninstalling via the MySQL Installer, confirming that C:\ProgramData\MySQL was removed, and then shutting Windows down completely before trying to re-install. The same result happens - I'm able to log in once, then several minutes later it will no longer accept a password. This is a fresh install again, so there's not a lot of pain in uninstalling and reinstalling. Any thoughts on why this is happening, or more importantly, how to correct the problem? TIA, -Tim -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: MySQL refusing to accept passwords
On 7/22/2011 5:02 PM, Shawn Green (MySQL) wrote: On 7/21/2011 22:45, Tim Thorburn wrote: Hello, For those keeping score, this will be the second time in the past few months I've come upon this problem. To recap, this is happening on a development laptop running Win7 64-bit Ultimate and MySQL 5.5.13. This morning, all was working well. This evening, I launched MySQL Workbench 5.2.34 CE to work on a table. When I attempt to access the server from within Workbench, I'm now prompted with a window asking for my password. Of course, my password is not accepted when I enter it - I'm presented with error #2000. Just to confirm, mysql --version returns: mysql Ver 14.14 Distrib 5.5.13, for Win64 (x86) This is not an upgrade, after my last mishap, I once again formatted the laptop with a fresh install of Windows 7 Ultimate 64-bit as well as MySQL 5.5.13. I've begun digging through bugs.mysql.com, but I'm not seeing any standing out. I should point out that this problem also breaks any sites running on this dev laptop as all passwords are no longer accepted. Any thoughts on what may be causing this? It seems to be happening every month or so at this point. Thanks in advance, -Tim Thorburn * Check your binary logs, someone may actually be changing your passwords. http://dev.mysql.com/doc/refman/5.5/en/mysqlbinlog.html * Be careful with what you backup/restore. You may accidentally revert your tables to a condition before you set the password. * mysql.exe is the command-line client. While it would be unusual to have a client utility that is of a different version than your server, the actual command to determine the version of the MySQL database server would be mysqld --version * did you attempt to login using mysql to see if the passwords really were different? Remember, the account 'root' for a new installation is not created without a password. If you had restored a very old copy of that table, that might have been your situation. * are you aware of the lost password reset instructions in the manual? http://dev.mysql.com/doc/refman/5.5/en/resetting-permissions.html Hi Shawn, Thanks for the reply. As this has happened before, and because I'm on a deadline, I ended up stopping the MySQL service with NET STOP MYSQL, then started MySQL with the skip-grant-tables option so that I could log in as root and make a backup via mysqldump. After this, I uninstalled MySQL from Control Panel, then proceeded to delete C:\Program Files\MySQL and C:\ProgramData\MySQL directories before rebooting to do a clean install of MySQL 5.5.14. Before this, I did try to simply reset the root password by once again stopping the MySQL service, starting it with --skip-grant-tables; however regardless of what I changed the password to, I received the same error. This error was present for each login I had on the MySQL server. Unfortunately, now that I've uninstalled and deleted the previous MySQL directories, it seems unlikely that I'll have access to the previous set of logs. I do, however, have a complete backup of --all-databases from mysqldump. Would there be anything in here that might shed some light on the issue? I'm at a loss here. The only different things I had done between when MySQL was working and when it decided to no longer accept my passwords was to launch Chrome instead of Firefox to load a specific Google page and to allow Bonjour to update iTunes and Safari on this laptop. Though I can't see how either of those would have any impact on MySQL. Thanks again, -Tim Thorburn
MySQL refusing to accept passwords
Hello, For those keeping score, this will be the second time in the past few months I've come upon this problem. To recap, this is happening on a development laptop running Win7 64-bit Ultimate and MySQL 5.5.13. This morning, all was working well. This evening, I launched MySQL Workbench 5.2.34 CE to work on a table. When I attempt to access the server from within Workbench, I'm now prompted with a window asking for my password. Of course, my password is not accepted when I enter it - I'm presented with error #2000. Just to confirm, mysql --version returns: mysql Ver 14.14 Distrib 5.5.13, for Win64 (x86) This is not an upgrade, after my last mishap, I once again formatted the laptop with a fresh install of Windows 7 Ultimate 64-bit as well as MySQL 5.5.13. I've begun digging through bugs.mysql.com, but I'm not seeing any standing out. I should point out that this problem also breaks any sites running on this dev laptop as all passwords are no longer accepted. Any thoughts on what may be causing this? It seems to be happening every month or so at this point. Thanks in advance, -Tim Thorburn
Re: MySQL loses password?
Ok, ran several scans on my dev PC. Unsurprisingly, nothing was found. Trying to use command line produces the error: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) The same Access denied for user 'root'@'localhost' (using password: YES) happens when trying to use MySQL Workbench 5.2.33 CE. phpMyAdmin gives an error #2000 Cannot log in to the MySQL server. mysql --version returns: mysql Ver 14.14 Distrib 5.5.11, for Win64 (x86) I'm guessing I'll be uninstalling/removing MySQL completely tomorrow and doing a clean install of 5.5.13. Although it would be handy to know what caused this problem in the first place. It's more than a little concerning when Friday everything works, shutdown computer for the night, log in again Saturday to find MySQL doesn't so much like my passwords anymore. On 6/12/2011 3:33 PM, Claudio Nanni wrote: This happens when you use an old client / library. Can you try from command line? Also issue: mysql --version Claudio On Jun 12, 2011 3:09 PM, Tim Thorburn webmas...@athydro.com mailto:webmas...@athydro.com wrote: There's been no upgrade or old pre-upgrade on this machine. I say the same dev password for years, as it is the same password I've used on my dev machines throughout the years. This machine started off as a fresh install of the OS several months ago. The only version of MySQL ever on this particular machine is 5.5.11. My confusion is mostly centered around the it worked fine on Friday, then Saturday happened issue. I've run a complete virus scan and found nothing, as well as several spyware/malware scans - it's in the process of running a scan from a rescue disc, so I'll know if there's anything else afterward. Seems odd anyone would bother hacking into this dev machine that's barely connected to the Internet. On 6/12/2011 8:59 AM, Johan De Meersman wrote: If it's recently been upgraded or had an old pre-upgrade backup restored, that's not a major surprise; and surely you won't have ben running mysql on a win7 for several years :-) In brief, mysql changed password encryptions between 4.1 and 5.0, for various reasons. The old password scheme is still supported, but iird the default setting for that in newer versions is off, yielding you the error you are reporting. Of course, if none of that is the case, you may have been hacked; but it seems somehow strange that a hacker would bother to install oldstyle passwords. The error message you provide also mentions the oldpasswd flag for PHP 5.2 - also worth looking at. - Original Message - From: Tim Thorburnwebmas...@athydro.com mailto:webmas...@athydro.com To: mysql@lists.mysql.com mailto:mysql@lists.mysql.com Sent: Sunday, 12 June, 2011 2:50:22 PM Subject: MySQL loses password? Hi all, I came across something strange today on my dev machine and thought I'd see if anyone here has run into a similar problem. To begin, my dev machine is Win7 Ultimate 64-bit, running MySQL 5.5.11 (also 64-bit). Today when I tried to log into the server using the old MySQL GUI tools as root, I got an error number 1045 Access denied for user 'root'@'localhost' (using password: YES). This is odd because I've not changed the root password on my dev machine in years. When I tried to goto a site on this same machine, Apache throws the following message: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file This is the first time I've seen such a message, or had MySQL randomly stop accepting my root password. I'll likely be doing a complete uninstall and reinstall in a few hours on this machine, but thought I'd ask here to see if anyone had any thoughts as to why this happened, and how I might correct it? If at all possible, I'd prefer to not have to do an uninstall/reinstall as I wisely hadn't backed up a few tables I was working on over the last couple days. Any thoughts? Thanks in advance, -Tim -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=claudio.na...@gmail.com
MySQL loses password?
Hi all, I came across something strange today on my dev machine and thought I'd see if anyone here has run into a similar problem. To begin, my dev machine is Win7 Ultimate 64-bit, running MySQL 5.5.11 (also 64-bit). Today when I tried to log into the server using the old MySQL GUI tools as root, I got an error number 1045 Access denied for user 'root'@'localhost' (using password: YES). This is odd because I've not changed the root password on my dev machine in years. When I tried to goto a site on this same machine, Apache throws the following message: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file This is the first time I've seen such a message, or had MySQL randomly stop accepting my root password. I'll likely be doing a complete uninstall and reinstall in a few hours on this machine, but thought I'd ask here to see if anyone had any thoughts as to why this happened, and how I might correct it? If at all possible, I'd prefer to not have to do an uninstall/reinstall as I wisely hadn't backed up a few tables I was working on over the last couple days. Any thoughts? Thanks in advance, -Tim -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: MySQL loses password?
There's been no upgrade or old pre-upgrade on this machine. I say the same dev password for years, as it is the same password I've used on my dev machines throughout the years. This machine started off as a fresh install of the OS several months ago. The only version of MySQL ever on this particular machine is 5.5.11. My confusion is mostly centered around the it worked fine on Friday, then Saturday happened issue. I've run a complete virus scan and found nothing, as well as several spyware/malware scans - it's in the process of running a scan from a rescue disc, so I'll know if there's anything else afterward. Seems odd anyone would bother hacking into this dev machine that's barely connected to the Internet. On 6/12/2011 8:59 AM, Johan De Meersman wrote: If it's recently been upgraded or had an old pre-upgrade backup restored, that's not a major surprise; and surely you won't have ben running mysql on a win7 for several years :-) In brief, mysql changed password encryptions between 4.1 and 5.0, for various reasons. The old password scheme is still supported, but iird the default setting for that in newer versions is off, yielding you the error you are reporting. Of course, if none of that is the case, you may have been hacked; but it seems somehow strange that a hacker would bother to install oldstyle passwords. The error message you provide also mentions the oldpasswd flag for PHP 5.2 - also worth looking at. - Original Message - From: Tim Thorburnwebmas...@athydro.com To: mysql@lists.mysql.com Sent: Sunday, 12 June, 2011 2:50:22 PM Subject: MySQL loses password? Hi all, I came across something strange today on my dev machine and thought I'd see if anyone here has run into a similar problem. To begin, my dev machine is Win7 Ultimate 64-bit, running MySQL 5.5.11 (also 64-bit). Today when I tried to log into the server using the old MySQL GUI tools as root, I got an error number 1045 Access denied for user 'root'@'localhost' (using password: YES). This is odd because I've not changed the root password on my dev machine in years. When I tried to goto a site on this same machine, Apache throws the following message: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file This is the first time I've seen such a message, or had MySQL randomly stop accepting my root password. I'll likely be doing a complete uninstall and reinstall in a few hours on this machine, but thought I'd ask here to see if anyone had any thoughts as to why this happened, and how I might correct it? If at all possible, I'd prefer to not have to do an uninstall/reinstall as I wisely hadn't backed up a few tables I was working on over the last couple days. Any thoughts? Thanks in advance, -Tim -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Unable to add users with MySQL 5.5.8 under Windows
Hello, I just downloaded MySQL 5.5.8 (Win64 version) today and installed it on my dev machine. Previously I had MySQL 5.1.51 installed - as I've always felt it was better to uninstall the old before installing the new with Windows, I uninstalled 5.1.51 by doing the following: - As Administrator, I ran DOS prompt and entered NET STOP MYSQL - Ran MySQL Instance Configuration Wizard to remove the current instance - Uninstalled MySQL Server 5.1.51 from Control Panel - Went through my Users, ProgramData, and Program Files folders to delete any references to MySQL. - Reboot computer I should mention this is Windows 7 Ultimate 64-bit. After rebooting I installed MySQL 5.5.8 for Win64 using the downloaded MSI file. Once MySQL was installed, I downloaded and installed the current version of Workbench (5.2.31a). When I run Workbench, I see that the MySQL server is indeed running - I'll also mention that this is my first time using Workbench, until now I had been using the older MySQL Administrator GUI, however it stopped working with 5.5.8. So, back in Workbench, I goto Manage Security under the Server Administration heading, choosing the default Local instance: MySQL server to connect to. Next I click Accounts and finally Add Account at the bottom of this screen. Under Details for Account newu...@% I add in the user name I want, type the password twice, I've tried leaving Limit Connectivity to Hosts Matching as % and localhost. Once I'm finished adding the user, I click Apply - however I'm presented with the following error message: /Unhandled exception: Error adding account accountn...@%:/ I've tried adding a user in MySQL Administrator, as I am more familiar with it. It provides a different error: /Error while storing the user information. The user might have been deleted. Please refersh the user list./ A command prompt pop-up appears with this error stating the following: /** Message: save user: error adding new user entry /I've googled the above error messages and found that either bug reports with similar wording were either abandoned, or supposed to be fixed already. Any thoughts, or should I go back to 5.1.51 and wait for the next point release of the 5.5 line? TIA, -Tim
Re: Unable to add users with MySQL 5.5.8 under Windows
On 12/16/2010 3:42 AM, Tim Thorburn wrote: I should mention this is Windows 7 Ultimate 64-bit. After rebooting I installed MySQL 5.5.8 for Win64 using the downloaded MSI file. Once MySQL was installed, I downloaded and installed the current version of Workbench (5.2.31a). When I run Workbench, I see that the MySQL server is indeed running - I'll also mention that this is my first time using Workbench, until now I had been using the older MySQL Administrator GUI, however it stopped working with 5.5.8. So, back in Workbench, I goto Manage Security under the Server Administration heading, choosing the default Local instance: MySQL server to connect to. Next I click Accounts and finally Add Account at the bottom of this screen. Under Details for Account newu...@% I add in the user name I want, type the password twice, I've tried leaving Limit Connectivity to Hosts Matching as % and localhost. Once I'm finished adding the user, I click Apply - however I'm presented with the following error message: /Unhandled exception: Error adding account accountn...@%:/ I've tried adding a user in MySQL Administrator, as I am more familiar with it. It provides a different error: /Error while storing the user information. The user might have been deleted. Please refersh the user list./ A command prompt pop-up appears with this error stating the following: /** Message: save user: error adding new user entry To add, I was able to successfully add a user to MySQL 5.5.8 with phpMyAdmin - would this point to a bug in the GUI tools? Thanks again
Re: uninstall/reinstall
On 10/19/2010 12:38 PM, Montgomery, Tammie wrote: I had an old version of mySQL on my computer but never used it. I thought I knew the root password but it wouldn't let me in. I went ahead and uninstalled it thinking I would get a newer version anyway. I used the Windows interface to uninstall the previous version. It appeared to be gone but when I installed the new version, it asked me what the previous root password was and then give new one. I left previous blank and gave it the new password. Now it has been sitting at the screen in the configuration wizard for Apply security settings for about 20 minutes. How should I recover from this? Barracuda 400 vers 3.5.12 Checked - Virus Free I ran into a similar problem a few weeks ago. The solution, in my case, was that you must first stop the MySQL process, uninstall with the provided uninstall utility, then manually go through Program Files and ProgramData (possibly a folder in your Users directory as well) to delete all references to MySQL. When the installer is run for the most current version of MySQL that you've downloaded, it won't ask for the previous password and it will be as if you're installing a fresh copy. If I remember correctly, you can still do this now even after you've already uninstalling the original version of MySQL. I should mention this was all done in Win7 64-bit; you may need to modify folder names if you're on WinXP.
MySQL Error 1045
Hello, A few days ago I ran into Error 1045 when attempting to add a new database user to my development machine. The error only occurred when trying to connect to the database as a new user which I found a little odd. After searching Google I discovered that this error is caused by a timeout - I should probably mention that my development machine is Win7 Ultimate 64-bit; I was using MySQL 5.1.45. Having no luck solving error 1045 I chose to uninstall MySQL and re-install the most up to date version from mysql.com being 5.1.50, again choosing Windows 64-bit. To uninstall I first went to the control panel to remove MySQL, however this did not remove the Windows service. I did find that running the installer file will remove existing services - which is how I was finally able to remove it. I believe I've now gotten as close to a clean uninstall of MySQL as I can at this point. When I run the installer now it gets up to the final processing configuration stage, but when it attempts to apply security settings I'm again presented with the dreaded error 1045 Access denied for user 'r...@localhost' (using password: YES). The error message goes on to suggest that I open TCP port 3306 in my firewall. This machine came pre-installed with McAfee AntiVirus Plus - for good or bad it's worked fine for me up until this point. I've opened port 3306 under Ports and System Services; yet the error still persists. Any thoughts on what I can do now? TIA, -Tim
Re: MySQL Error 1045
Ignore that ... it's amazing how you can solve problems with enough caffeine and enough time away from a computer screen . On 9/20/2010 10:58 PM, Tim Thorburn wrote: Hello, A few days ago I ran into Error 1045 when attempting to add a new database user to my development machine. The error only occurred when trying to connect to the database as a new user which I found a little odd. After searching Google I discovered that this error is caused by a timeout - I should probably mention that my development machine is Win7 Ultimate 64-bit; I was using MySQL 5.1.45. Any thoughts on what I can do now? TIA, -Tim
Importing CSV into MySQL
Hi, I'm sure I'm missing something quite obvious here, but the caffeine hasn't quite kicked in yet. As the subject says, I'm importing a csv file into MySQL 5.1.36 on WinXP using phpMyAdmin 3.3.2 (Apache 2.2.11 and PHP 5.3.0 should it matter). I've done this many times, however I'm now getting a strange error regarding a character in my csv file. I've tried both MyISAM and InnoDB tables (I don't think that would make any difference) and switching between utf8_general_ci and utf8_unicode_ci (thought this might make a difference, but sadly no). The error message I get is |#1366 - Incorrect string value: '\xE8s' when it attempts to insert the word Radès. I'm using a simple varchar, nothing really special there. After googling for awhile it seems the most common option is to use PHP to convert the character into UTF8 format before putting it into MySQL - the problem is some of these csv's are several hundred mb a piece so I'd much rather simply import than go this route. Any thoughts? TIA, -Tim |
selecting DISTINCT and COUNT in MySQL
Hi, I'm setting up a small tracking program for a site I'm working on - basically it monitors all external web and email links that are clicked from our site and stores them into a MySQL database. Now I'm trying to extract the information from the database and display it on screen with PHP. I've made a query which reads: SELECT DISTINCT trEmail FROM db-name; This clearly selects all the distinct email addresses from my table, but I would like to put a count beside each of the distinct addresses to show how many times each link was clicked. For example, I'd like it to look something like the following: email address # sent [EMAIL PROTECTED] 12 Meaning that the email addresses '[EMAIL PROTECTED]' was clicked a total of 12 times. I'm thinking there should be a way to do this with a single SQL query ... although after most of the day of trying and searching google - I've come up with nothing but a headache. Any thoughts? Thanks -Tim -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Searching a MySQL database
Hi, I've got a script setup to search two tables in a MySQL database. The first page asks the user to select which table they'd like to search, and then enter in some key words. The second page then determines which table the user selected and performs the search. Right now, I'm going through each row with the following RowName LIKE .$searchTerm. but there are 27 rows (it's not the largest of sites I'm working on now). Is there a faster/better way to do this? Thanks -Tim - 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
apostrophe's in PHP MySQL
Hi, I've been experiencing some sporadic problems with a few web forms written in PHP 3.0.16 and MySQL 3.23.31 with text fields (both single lines and rows). Generally if any of the text in these forms contains an apostrophe - either nothing is entered into the database, or nothing after the apostrophe is entered. Is there a way around this? Or is this a limitation of my older versions of PHP and MySQL? Thanks -Tim - 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
[MySQL] Inserting images into a MySQL DB
Hi, I'm attempting to store jpg images into a MySQL DB using PHP. I've found a few sample scripts that should do this for me, however, they don't seem to be working. Could someone take a look at this and see if you notice any problems? Thanks -Tim ?php if ($submit) { MYSQL_CONNECT(localhost,user,pass); mysql_select_db(binary_date); $data = addslashes(fread(fopen($form_data, r), filesize($form_data))); $result=MYSQL_QUERY(INSERT INTO binary_date (description,bin_data,filename,filesize,filetype) . VALUES ('$form_description','$data','$form_data_name','$form_data_size','$form_data_type')); $id= mysql_insert_id(); print pThis file has the following Database ID: b$id/b; MYSQL_CLOSE(); } else { ? form method=post action=?php echo $PHP_SELF; ? enctype=multipart/form-data File Description:br input type=text name=form_description size=40 INPUT TYPE=hidden name=MAX_FILE_SIZE value=100 brFile to upload/store in database:br input type=file name=form_data size=40 pinput type=submit name=submit value=submit /form ?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
Displaying MySQL database with DATE_FORMAT
Hi, I've developed a simple search engine for a site I'm working on. Its purpose is to display community events based on the users input criteria. The problem is, if I use the DATE_FORMAT command to alter the appearance of the events dates and times - then MySQL begins at the top of the list using the exact order of dates and times, rather than listening to the initial query and taking only the relevant dates and times. However, if I leave out the DATE_FORMAT and TIME_FORMAT commands, it works perfectly, just without the nice friendly display. Any thoughts? Here is a sample of my script: if (!$db) { echo Error: Could not connect to database. Please try again later.; exit; } $query = select * from comcal2001 where .$searchtype. like '%.$searchterm.%'; $result = mysql_query($query, $db); $resultdate = mysql_query (SELECT DATE_FORMAT(EventStartDate, '%W %M %D %Y') AS EventStartDate FROM comcal2001); $resulttime = mysql_query (SELECT TIME_FORMAT(EventStartTime, '%r') AS EventStartTime FROM comcal2001); if (!$result) echo Error running query: $querybr.mysql_error($db); else $num_results = mysql_num_rows($result); $num_rows = mysql_numrows($result); echo pNumber of Events found: .$num_rows./p; for ($i=0; $i $num_rows; $i++) { $row = mysql_fetch_array($result); echo pb.($i+1).. Event: ; echo ($row[EventName]); echo /bbrMonth: ; echo ($row[EventMonth]); echo brLocation: ; echo ($row[EventLocation]); echo brCity: ; echo ($row[EventCity]); echo , ; echo ($row[EventState]); echo brTime: ; $rowtime = mysql_fetch_array($resulttime); echo ($row[EventStartTime]); echo brDate: ; $rowdate = mysql_fetch_array($resultdate); echo ($row[EventStartDate]); echo brDescription: ; echo ($row[EventDescription]); echo brCost: ; echo ($row[EventCost]); echo /p; } ? Thanks -Tim - 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
[MySQL] DATE_FORMAT
Hi, I've setup a database to keep track of various events. Now I'm working on displaying these events on the screen through a web browser. I've got all the crucial information displaying - now its time for a little fine tuning. All the dates in my database are ISO format, so -MM-DD, I'd like to display them in a more user friendly format. For example, there is an event taking place this Wednesday, in ISO 2001-05-30 - I'd like it to display as May 30th, 2001. Through the command line, I know I do this by typing: select DATE_FORMAT(EventStartDate, '%M %D %Y'); My question is how would i get this information to display via 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
[MySQL] Reporting time in Greenwich Mean Time
Hi, I've got a time/date stamp for a database I'm working on which logs the last time and date that any changes were made to the database. What I'd like to be able to do is have the time be set to Greenwich Mean Time rather than the local time of the server. Current I'm using NOW() to enter the time/date stamp. Does anyone know how this could be done? Thanks -Tim - 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
MySQL sorting
Hi, I'm using PHP to pull information out of my MySQL database - although its not entirely working. Here is the line: $result = mysql_query(SELECT * FROM comcal2001 WHERE id=$id and EventMonth='May',$db); What I'd like this to do is select all the fields in my database where the month = May and display them on the screen. However, it displays every field. Could someone shed some light on this for me? Thanks -Tim - 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: MySQL sorting
The problem is that this line is not telling MySQL that I want it to select only the fields where the EventMonth = May. Displaying the other fields is not a problem at this time. At 09:54 PM 5/24/2001 -0500, you wrote: At 9:49 PM -0500 5/24/01, Tim Thorburn wrote: Hi, I'm using PHP to pull information out of my MySQL database - although its not entirely working. Here is the line: $result = mysql_query(SELECT * FROM comcal2001 WHERE id=$id and EventMonth='May',$db); What I'd like this to do is select all the fields in my database where the month = May and display them on the screen. However, it displays every field. The line above doesn't display anything. You're describing a problem that doesn't relate to the code you're showing, as far as I can tell. Can you be more specific? PHP won't display anything except what you tell it to... Could someone shed some light on this for me? Thanks -Tim -- Paul DuBois, [EMAIL PROTECTED] - 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
Telnet into MySQL
Hello, Can someone here recommend a good Telnet program (with SSH) that I can use to connect to my servers MySQL database? Preferably something shareware/freeware - but if it must be purchased, I'm not against that. Thank you -Tim - 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: Telnet into MySQL
Okok, my bad!! What I meant to say was that I needed a Telnet program with SSH so that I could log into the shell of my web hosting provider and thereby access MySQL from shell. At 05:46 PM 5/21/2001 -0500, you wrote: At 4:04 PM -0600 5/21/01, [EMAIL PROTECTED] wrote: Any good ones for the Windozes version..When I use just regular ol Telnet I get Smiley and clovers and hearts and the version. That's exactly why you don't Telnet to the MySQL server. You're seeing information that's part of the binary client-server protocol. Use the mysql program instead. Cheers -Original Message- FROM: Eric Fitzgerald TO: Angerer, Chad, 'Tim Thorburn', [EMAIL PROTECTED] DATE: Mon 5/21/01 15:58 SUBJECT: Re: Telnet into MySQL I really prefer SecureCRT from VanDyke software myself. Perfect blend of features and simplicity for my needs. It has a shareware version that does expire, but the license is cheap for it. Go to www.vandyke.com and download the shareware version to give it a try. - Original Message - From: Angerer, Chad [EMAIL PROTECTED] To: 'Tim Thorburn' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, May 21, 2001 1:58 PM Subject: RE: Telnet into MySQL go to www.ssh.com .. I beleieve there a few nice clients there. Chad -Original Message- From: Tim Thorburn [mailto:[EMAIL PROTECTED]] Sent: Monday, May 21, 2001 3:21 PM To: [EMAIL PROTECTED] Subject: Telnet into MySQL Hello, Can someone here recommend a good Telnet program (with SSH) that I can use to connect to my servers MySQL database? Preferably something shareware/freeware - but if it must be purchased, I'm not against that. Thank you -Tim - 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 - 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 -- Paul DuBois, [EMAIL PROTECTED] - 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
[MySQL] Backwards Compatible?
Hello, Is MySQL backwards compatible? On my main machine I'm running MySQL 3.23.36 and our hosting company is using MySQL 3.22.32 - the database I've created is a simple listing of local businesses with contact information, so I don't believe there would be any issues of my using features that would not have been present in the earlier version. Any thoughts? We'll be setting up most of the database information tomorrow afternoon - as always, rushed to the last minute. Thanks -Tim - 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
[MySQL] User name/password
Hello, After playing around for a few days in between real work, I got my new linux box up and running with RedHat 7.0 and MySQL 3.23.33 (the version the hosting company we use supports). My problem is that I know what password I use for the database as I need to type it in every time I start MySQL - but I don't know what username I used. Is there anywhere I can look to see what username I used? In order for our database to go online, the hosting company needs both the username/password - since we're going live tomorrow, this is one of those desperate mission critical messages - much like most of the messages on this list ;) Thanks -Tim - 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
[MySQL] Backup error
Hello, I have a box running Win2k and MySQL 3.23.36, I had made a backup of all my databases/tables to CD-ROM last week. When I tried to access them again from the CD-ROM, I noticed that all file names had been altered to be displayed in uppercase and now they will not function in the php scripts I had generated. I've tried renaming the files to lowercase letters with no luck. Fortunately, these were only test databases so there won't be much loss. My question is in the future, is there a recommended way of backing up the databases that will not cause any errors? Also, would anyone know of a fix to my current problem? As I said, it was only a test database that was lost, but it was one that I would like back without going through another week of tweeking to get it back the way it was. Thanks -Tim - 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
MySQL 3.22.32 and RedHat 7.0
Hello, I'm a MySQL newbie (hopefully, there's a few others of me around so I won't feel like I stick out so much). I've setup a Linux box running Red Hat 7.0 with Apache 1.3.12, PHP 3.0.18, and MySQL 3.22.32 (I know its an older version, but our web hosting service has not upgraded their version and it does not sound as though they plan to do so any time soon). All seems to be running well, except for the unfortunate problem that I cannot get mysql to start. I have followed the steps in the documentation provided with the source code from mysql.com I have MySQL installed at /usr/local/mysql-3.22.32/ when I type mysql.server start I am told that either the file does not exist or I have no permission to use it. I'm logged on as root, and I've setup the user and group to mysql as the manual states. Has anyone else had any difficulties getting MySQL and RedHat 7.0 to work? As I said, I'm rather new at this so I'm grabbing at straws. Thank you -Tim - 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