How do I uninstall MySQL completely?

860

First remove MySQL in ordinary way (using apt-get purge or yum remove). After that issue:

rm -rf /var/lib/mysql

to be sure that MySQL data is completely deleted

Share:
860

Related videos on Youtube

jamesTheProgrammer
Author by

jamesTheProgrammer

Updated on September 17, 2022

Comments

  • jamesTheProgrammer
    jamesTheProgrammer over 1 year

    I have some data in a old MSSQL 2000 db. I am trying to move a couple tables from it to a mySQL (V 5.025) db. In the past I created a flat csv files from the MSSQL db and imported into an empty desination table in the mySQL db using this code snippet:

    LOAD DATA INFILE '/moodle/sourcefile.csv' INTO TABLE tablename
               FIELDS TERMINATED BY ','
    

    I would like to do a direct, programmatic selection from source, insert into destination process. I am using Coldfusion (MX) to read from the MSSQL table, which is getting the data from the source db fine.

    I have created a connection object using this code:

    classLoader = createObject("java", "java.lang.Class");
    classLoader.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    dm = createObject("java","java.sql.DriverManager");
    

    I can dump the dm object and its fine, ready to be used.

    I am attempting to create an odbc connection to the mySQL table like this: This is the code that is failing.

    con = dm.getConnection("jdbc:odbc:DRIVER={MySQL ODBC 3.51 Driver}; SERVER=ipaddress; PORT=3306; DATABASE='dbname'; USER='username'; PASSWORD='password'; OPTION=3;");
    

    The error it is generating is

    "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"

    Any ideas on how to correct this error (make connection work) OR a different perspective on how to move this data is appreciated.

    • Ian Stanway
      Ian Stanway over 14 years
      What platform? Windows / Linux / etc...
    • Leigh
      Leigh about 12 years
      Just curious, any reason you cannot set up a regular datasource? If you update the driver, you should be able to connect to MySQL5 from MX.
    • jamesTheProgrammer
      jamesTheProgrammer about 12 years
      do you mean create a dsn for the mySQL db in CFIDE?
    • Leigh
      Leigh about 12 years
      Yes, via the CF Administrator.
    • jamesTheProgrammer
      jamesTheProgrammer about 12 years
      the CFIDE only lists MySQL(3.x) as option, I am using 5.0.25 - getting error trying to set up DSN "Connection verification failed for data source: studentMoodle java.sql.SQLException: Communication failure during handshake. Is there a server running on ipaddress:port?"
    • Leigh
      Leigh about 12 years
      Yes, you have to update the driver and use type "Other". See the link in my previous post for the instructions.
    • jamesTheProgrammer
      jamesTheProgrammer about 12 years
      You have been helpful, I appreciate it. Not sure what to put in the parameters in other type, specifically: JDBC URL , Driver Class , Driver Name
    • Leigh
      Leigh about 12 years
      Yeah, not the greatest example in the article. The driver class is com.mysql.jdbc.Driver. Note, it is case sensitive! The driver name does not matter. The url depends on your server and port. But an example is: jdbc:mysql://127.0.0.1:3306/MyDatabaseName
    • jamesTheProgrammer
      jamesTheProgrammer about 12 years
      is the driver class a path to a file on my system? still getting error "No suitable driver available for studentmoodle, please check the driver setting in resources file, error: null"... I did install the ODBC connector referenced in answer
    • Leigh
      Leigh about 12 years
    • Umair Khan
      Umair Khan about 6 years
      is your problem solved ?
  • Sam Halicke
    Sam Halicke over 14 years
    Then, remove /etc/my.cnf and $HOME/.my.cnf to destroy any lingering configuration settings.