MySQL errors

Discussion in 'Installation' started by hippityhopper, Jul 27, 2005.

  1. hippityhopper

    hippityhopper New Member

    Joined:
    Jul 27, 2005
    Messages:
    6
    Hello:

    I was with a host and I installed it on my first host with no problems. I then decided to switch hosting companies. I backed up the DB via phpmyadmin. I installed the script on the new server and went to update the DB via phpmyadmin and received the following error:

    CREATE TABLE `amember_access_log` (
    `log_id` int( 11 ) NOT NULL AUTO_INCREMENT ,
    `member_id` int( 11 ) NOT NULL default '0',
    `time` timestamp NOT NULL default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
    `url` varchar( 255 ) default NULL ,
    `remote_addr` varchar( 15 ) default NULL ,
    `referrer` varchar( 255 ) default NULL ,
    PRIMARY KEY ( `log_id` ) ,
    KEY `member_id` ( `member_id` , `time` , `remote_addr` ) ,
    KEY `time` ( `time` )
    ) ENGINE = MYISAM DEFAULT CHARSET = latin1

    MySQL said: Documentation
    #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 'CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
    `url` varchar(

    Now, my hosting account from my first host is still active. So, thinking this was db in not the correct format, I logged in to amember and backed up the DB via the backup feature of amember. I then proceeded to my new host and tried once again to upload the DB via phpmyadmin. Same error. I also tried using the "restore" feature in amember. I then got an error stating that the database was an incorrect one.

    I contacted my new host. They asked what version of SQL was being run. My old host was running MySQL 4.1.10a-standard. My new host is running 4.0.24-standard. My new host is telling me that it is possible that some of the stuff in the database is not compatible with the older version of SQL (such as their version/4.0.24-standard).

    Could this be possible? I have even tried deleting the DB completely. Creating a new one and using just the sql file that comes with the script. I get the same exact error with that one. I have tried manually adding the tables and keys. I create the amember_access_log table, then when I try to run the amember script, it tells me of another table that is not created.

    Any ideas? All help is greatly appreciated.
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    of course, it happens because different version of MySQL used. try to make backup using aMember CP -> Backup, then restore it using phpmyadmin.
  3. hippityhopper

    hippityhopper New Member

    Joined:
    Jul 27, 2005
    Messages:
    6
    I have already tried that method as well as others, same error(s). I have deicded that it be best that I get hosting from a company that keeps up-to-date on their server software. With a company that has older versions of software, I may have problems with other script I might try to install.
  4. senrats

    senrats New Member

    Joined:
    Jan 23, 2005
    Messages:
    13
    I am getting errors trying to move to a different host and think I need some help.

    When I try and access the admin log in, this is what I get:

    Cannot connect to MySQL: Access denied for user 'webadmin'@'localhost' (using password: YES)


    I have backed up the database using the admin control panel, but that's about it. Am I missing something?
  5. hippityhopper

    hippityhopper New Member

    Joined:
    Jul 27, 2005
    Messages:
    6
    senrats,

    I take it that you backed up all the amember files from your original host, then uploaded them to your new host and then used the database from your new host, correct?

    If so, that would explain your errors. You are getting this error because with the username, database, and password info you have in your original config file, it can't connect to the current database.

    When you install amember, it stores the database name and password in the config.inc.php file. The problem lies in that most database names have a partial name based upon your hosting account username.

    Let's say your first host your username was fred and the database you created was amember. Your database might have been named "fred_amember". Now, your new host, you might have the username for your hosting account to be john. If you create a database there called amember, it might be called "john_amember".

    There's a few methods you can use:
    1.) Login to your hosting account, create a username and database as oyu did on your previous host. Write that info down. Open up the config.inc.php file and scroll down to about line 30. You will see something like $pc['db'], below that $pc['user']. The first one is the name of the database, the second is the username for that database. Below that is the password for the username of that database. Then, login to phpmyadmin and import that database.

    2.) upload a fresh copy of amember. Next install it as you originally done on your first host. Once installed login to the admin and go to the restore db and restore the db via the database you backed up.

    Hope this helps some.
  6. senrats

    senrats New Member

    Joined:
    Jan 23, 2005
    Messages:
    13
    Cool.. I've done that and I now have one more question.

    Do I need to change this config.inc.php line:
    $pc['prefix'] = 'amember_';


    IF I changed the name of the amember folder to something like
    "bpmember". Will it try to call that directory or something else.
  7. senrats

    senrats New Member

    Joined:
    Jan 23, 2005
    Messages:
    13
    Reinstall questions

    1 -Can I reinstall and then upload the template files I used previously?
    They have the changed text and all.

    2 -Will the restore function add all the previous products to the newly installed amember control?
  8. hippityhopper

    hippityhopper New Member

    Joined:
    Jul 27, 2005
    Messages:
    6
    Do I need to change this config.inc.php line:
    $pc['prefix'] = 'amember_';


    No, that prefix of amember_ is what is used as the prefix for the tables in the amember database.

    Can I reinstall and then upload the template files I used previously?
    They have the changed text and all.


    I have never done this, but I see no reason why not. Don't quote me on it as I do not know offhand the exact format that the templates use, etc. However, I would see no reason why not as when you "restored" the amember database, you restored just the database, not the URLs. Unless a setting in the DB has to do with the paths to the templates then you should have no issues.

    Will the restore function add all the previous products to the newly installed amember control?

    Yes. The database is where all the product information, members, protected directories, etc info is stored. However, in regards to protected directories, you MIGHT have to reprotect them (i.e. login the admin part of the script and do the same procedure as you done before) because the script creates a .htaccess file in the directories u want to protect. Now, if when you backed up the script, you also backed up your protected directories (including the .htaccess file that was created, then you might not have to redo everything). To test it, just try to access the protected directories.

Share This Page