Rookie job search, database connectivity issues, online, etc.

Source: Internet
Author: User
I write the implementation of the registration function of the page, in the connection database bar data inserted in the database, the following problem occurs, the error message is:
Warning:mysql_query () [Function.mysql-query]: Access denied for user ' ODBC ' @ ' localhost ' (using password:no) in F:\wamp\w ww\biyesheji\html\reg_chk.php on line 18

Warning:mysql_query () [function.mysql-query]: A link to the server could not being established in F:\wamp\www\biyesheji\html \reg_chk.php on line 18
I checked the database name, the data table name, and the password (empty) are correct, but my database user name is root, why the error prompt will appear in ODBC, the Daniel help me, all tangled day, thank you thanks ...


Reply to discussion (solution)

Check the database connection code for the user name and password are not written correctly

With your ODBC prompt does not matter, it is not prompted you do not have a password, you need to give your MySQL account to create a password

Mysql>set Password =password (' your password '); Mysql>flush privileges;

My several pages do not have the password can also run Ah, this problem, the database code in the user name, the password is not wrong

Does your database connection code add @?
@mysql_connect (self:: $dbhost, Self:: $dbuser, Self:: $dbpassword);
@mysql_select_db (self:: $dbname);

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.