Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

mysql connect error

Community Beginner ,
Feb 17, 2010 Feb 17, 2010

Hi

I'm using CS4 DW with all the updates. I can log onto my local mysql database but when I setup for the one on my remote webserver

I get the following error

MySql Error 2000

mysqlind cannot connect to MYSQL4.1 using old authentication

This seems to be a standard error, is there a fix or am I missing something?

thanks

Ian

TOPICS
Server side applications
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 17, 2010 Feb 17, 2010

MySQL 4.1 introduced a more secure password system. You need to upgrade the password for your MySQL user account. The easiest way is to create a new user account.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 18, 2010 Feb 18, 2010

Hi David

thanks for the response, I changed the mysql database password to the following to try it (I've changed it again now)

jen00dorfstarw00d

this still gave me the same error.

Is this the correct format?  21 long including 4 numbers?

thanks

Ian

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 18, 2010 Feb 18, 2010

You can use whatever you like for the password. It's the way the password is encrypted by MySQL that changed in MySQL 4.1.

It sounds as though you are using a remote database that hasn't been upgraded properly. MySQL 4.1 came out so long ago that I no longer remember the exact details, but you needed to run a script to update the MySQL privileges table. This also updated the way passwords were stored.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 18, 2010 Feb 18, 2010

Hi David

thanks for the assist, I've done some more tests (Ok I read some manuals your included;-) )

Using PHP myadmin and mysql administrator I can log into my remote mysql database using the same settings I use in DW.

Using CS4 I'm selecting the database tab and then  MYSQL connection

In the window I'm  using:

Conection name: test

mysql server: the ip address given to me by the isp

username: xyz

password: password

If I then press the select database button  I get the error message.

The remote mysql database is running  mysql 5.0.77 via tcpip

The ISP is Fasthosts based in Gloucester

My logic is that if I can log on using phpmyadmin and mysql administrator then I'm doing something wrong in Dreamweaver. Just cant see what as I can log onto my Wamp mysql database with no problems.

Any ideas?

thanks

Ian

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 19, 2010 Feb 19, 2010
LATEST

hello sir, am isaac from u

ganda i also wanted to upload an im

ge in mysql database but i failed until igot on your tutorial about

Upload images to a MySQL database (PHP)

and i tried to use it but it seems i wasnet connecting to the server please help and correct this Error. for now am using "localhost" where i need to specify the "pass" and "User" but i don't understand this systax you used here

please help me

<?php define ('MAX_FILE_SIZE', 1024 * 50); ?>

<?php require_once('Connections/testConn.php'); ?>

<?php

if (!function_exists("GetSQLValueString")) {

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

{

  if (PHP_VERSION < 6) {

    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {

    case "text":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;   

    case "long":

    case "int":

      $theValue = ($theValue != "") ? intval($theValue) : "NULL";

      break;

    case "double":

      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";

      break;

    case "date":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;

    case "defined":

      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

      break;

  }

  return $theValue;

}

}

$editFormAction = $_SERVER['PHP_SELF'];


if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "uploadImage")) {
 
  // make sure it's a genuine file upload
  if (is_uploaded_file($_FILES['image']['tmp_name'])) {
 
    // replace any spaces in original filename with underscores
    $filename = str_replace(' ', '_', $_FILES['image']['name']);
    // get the MIME type
    $mimetype = $_FILES['image']['type'];
    if ($mimetype == 'image/pjpeg') {
        $mimetype= 'image/jpeg';
    }
    // create an array of permitted MIME types
    $permitted = array('image/gif', 'image/jpeg', 'image/png');
   
    // upload if file is OK
    if (in_array($mimetype, $permitted)
        && $_FILES['image']['size'] > 0
        && $_FILES['image']['size'] <= MAX_FILE_SIZE) {
      switch ($_FILES['image']['error']) {
        case 0:
          // get the file contents
          $image = file_get_contents($_FILES['image']['tmp_name']);
          // get the width and height
          $size = getimagesize($_FILES['image']['tmp_name']);
          $width = $size[0];
          $height = $size[1];

 
  $insertSQL = sprintf("INSERT INTO iimages (filename, mimetype, caption, image, width, height) VALUES (%s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($filename, "text"),
                       GetSQLValueString($mimetype, "text"),
                       GetSQLValueString($_POST['caption'], "text"),
                       GetSQLValueString($image, "text"),
                       GetSQLValueString($width, "int"),
                       GetSQLValueString($height, "int"));

  mysql_select_db($database_name, $db_name);
  $Result1 = mysql_query($insertSQL, $db_name) or die(mysql_error());

          if ($Result1) {
            $result = "$filename uploaded successfully.";
          } else {
            $result = "Error uploading $filename. Please try again.";
          }
          break;
        case 3:
        case 6:
        case 7:
        case 8:
          $result = "Error uploading $filename. Please try again.";
          break;
        case 4:
          $result = "You didn't select a file to be uploaded.";
      }
    } else {
      $result = "$filename is either too big or not an image.";
    }
  }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>File upload to database</title>
</head>

<body>
<?php
// if the form has been submitted, display result
if (isset($result)) {
  echo "<p><strong>$result</strong></p>";
  }
?>
<form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="uploadImage" id="uploadImage">
    <p>
        <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo MAX_FILE_SIZE; ?>" />
        <label for="image">Upload image:</label>
        <input type="file" name="image" id="image" />
    </p>
    <p>
      <label for="caption">Caption:</label>
      <input type="text" name="caption" id="caption" />
    </p>
    <p>
        <input type="submit" name="upload" id="upload" value="Upload" />
    </p>
    <input type="hidden" name="MM_insert" value="uploadImage" />
</form>
</body>
</html>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines