MySQL Run Error: Unable to connect driver, no root access solution

Source: Internet
Author: User
Tags root access

According to Crazy Java handout 13.3 of the program, found that the program run error.

1. Click Open Runconnmysql.cmd to run the file, the following results appear:

2. Compile and run with EditPlus, with the following results:

Error location to the 18th line of the program, and line 18th is the driver

Cause: Running the program requires MySQL database driver, the driver jar file is the E:\mysql-connector-java-5.1.30-bin.jar file, so you need to add the file to the environment variable CLASSPATH.

3. My Computer--right-click, properties--environment variables, add CLASSPATH environment variables:.; E:\mysql-connector-java-5.1.30-bin.jar(Note: Be sure to have a.; it means to include the current path)

4. Run with EditPlus again at this time

The program error points to 23 lines:

the description is a root permission issue. The reason is that root password is wrong, the password is not the program "32147", and it is my own password set.

4. Change the password of the program to my own password, then run it with EditPlus

Run the Runconnmysql.cmd file with the following results:

Summary: There are two errors: 1. mysql database driver E:\mysql-connector-java-5.1.30-bin.jar is not added to the CLASSPATH environment variable, resulting in SQL without driver files

2. When accessing SQL database, root password is incorrect, resulting in the inability to access SQL.

Issue: To avoid changing the program's root password each time you run the program, there is a way

1. My Computer-right-click, service-stop MySQL service

2. Add a skip-grant-tables command to the mysqld of the My.ini configuration file in the Programdata directory, the function of which is to skip permission validation and operate MySQL without verification.

3. Restart MySQL server: My Computer-right-click, service-start MySQL service

At this point, the user name and password in the program can access the SQL database arbitrarily

For example: change user name and password to "1", "1"

The results of the operation are as follows:

MySQL Run Error: Unable to connect driver, no root access solution

Related Article

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.