Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Mysql Wipe out all

  1. #1

    Default Mysql Wipe out all

    Dear all,
    I have not used my mysql for years. I do not remember any user associated with it or any database that I created inside it (no worries I do not need anything).

    I want to wipe out everything and start from the point like just having made the installation. 1.How I can wipe out all users and databases inside it (I have root permissions ofc)
    2. How then I can add a new mysql user?

    I would like to thank you in advance for your help

    B.R
    Alex

  2. #2
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,454

    Default Re: Mysql Wipe out all

    show databases;

    then
    drop database <name>;
    for each database except information_schema and mysql

    use mysql;
    INSERT INTO user (Host,User,Password) VALUES ('host','user',PASSWORD('password'));
    FLUSH PRIVILEGES;

    To define the new user's privileges:
    GRANT <privilege list> ON database.* TO 'User'@'Host' IDENTIFIED BY 'password' [WITH <limit list>];

  3. #3
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Mysql Wipe out all

    Remove /var/lib/mysql and /etc/my.cnf.

    Reinstall mysql package. You may have to force it. You get a fresh data directory.

  4. #4

    Default Re: Mysql Wipe out all

    I did it and it worked (or at least it looks it works)
    It looks though for asks for password when I try to login to mysql

  5. #5

    Default Re: Mysql Wipe out all

    Hm it does not seem to work
    Code:
    sudo /etc/init.d/mysql start
    redirecting to systemctl
    Job failed. See system logs and 'systemctl status' for details.

  6. #6
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,151

    Default Re: Mysql Wipe out all

    What have you got installed -- mariadb, mysql-cluster, mysql-community, and from where?

  7. #7

    Default Re: Mysql Wipe out all

    I have installed the best mysql packages

    I have the three repositories enabled

    Index of /distribution/12.1/repo/non-oss
    Index of /distribution/12.1/repo/oss
    Index of /update/12.1
    Index of /suse/12.1

    and I went to mysql-community-server and forced to update.

  8. #8
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,151

    Default Re: Mysql Wipe out all

    Perplexing. As you probably discovered it is messy to uninstall mysql with KDE installed. I took a more aggressive version of Ken's suggestion.
    Code:
     #  rpm -qa *mysql*
    libqt4-sql-mysql-4.8.0-243.1.x86_64
    mysql-community-server-client-5.5.16-3.3.1.x86_64
    libmysqld18-5.5.16-3.3.1.x86_64
    mysql-community-server-5.5.16-3.3.1.x86_64
    libreoffice-base-drivers-mysql-3.4.2.6-4.2.2.x86_64
    libmysqlclient18-5.5.16-3.3.1.x86_64
     #
     #  rcmysql stop
     #  rm -r /var/lib/mysql  /usr/share/mysql  /usr/lib64/mysql  /usr/bin/mysql*  /etc/my*   /etc/init.d/mysql 
    
     #  zypper install --force  mysql-community-server  mysql-community-server-client
     #  rcmysql start
     #  mysql
    mysql> 
    ...
    I was then able to import a database, and everything seemed normal. But I did not start with your error messages.

  9. #9

    Default Re: Mysql Wipe out all

    This is what I have installed


    Code:
    rpm -qa *mysql*
    libreoffice-base-drivers-mysql-3.4.2.6-4.2.2.x86_64
    libmysqld18-5.5.16-3.3.1.x86_64
    mysql-community-server-bench-5.5.16-3.3.1.x86_64
    libqt4-sql-mysql-4.7.4-19.4.1.x86_64
    perl-DBD-mysql-4.020-2.1.4.x86_64
    mysql-community-server-5.5.16-3.3.1.x86_64
    libmysqlclient16-5.1.57-0.3.1.x86_64
    libqt4-sql-mysql-32bit-4.7.4-19.4.1.x86_64
    php5-mysql-5.3.8-4.2.1.x86_64
    mysql-community-server-test-5.5.16-3.3.1.x86_64
    mysql-community-server-tools-5.5.16-3.3.1.x86_64
    mysql-community-server-client-5.5.16-3.3.1.x86_64
    libmysqlclient18-32bit-5.5.16-3.3.1.x86_64
    libmysqlclient18-5.5.16-3.3.1.x86_64


    and then I did

    Code:
    zypper install --force  mysql-community-server  mysql-community-server-client
    Daten des Repositories laden ...
    Installierte Pakete lesen ...
    Installation von 'mysql-community-server-5.5.16-3.3.1.x86_64' aus Repository 'openSUSE-12.1 OSS' wird erzwungen.
    Installation von 'mysql-community-server-client-5.5.16-3.3.1.x86_64' aus Repository 'openSUSE-12.1 OSS' wird erzwungen.
    Paketabhängigkeiten auflösen ...
    
    Die folgenden Pakete werden erneut installiert:
      mysql-community-server mysql-community-server-client 
    
    2 zu installierende Pakete.
    Gesamtgröße des Downloads: 7,2 MiB. Kein zusätzlicher Speicherplatz wird nach dieser Operation belegt oder freigegeben.
    Fortfahren? [j/n/?] (j): j
    Paket mysql-community-server-client-5.5.16-3.3.1.x86_64 wird abgerufen (1/2), 736,0 KiB (17,0 MiB entpackt)
    Abruf: mysql-community-server-client-5.5.16-3.3.1.x86_64.rpm [fertig]
    Paket mysql-community-server-5.5.16-3.3.1.x86_64 wird abgerufen (2/2), 6,5 MiB (41,6 MiB entpackt)
    Abruf: mysql-community-server-5.5.16-3.3.1.x86_64.rpm [fertig (5,1 MiB/s)]
    Installation von: mysql-community-server-client-5.5.16-3.3.1 [fertig]
    Installation von: mysql-community-server-5.5.16-3.3.1 [fertig]
    Zusätzliche rpm-Ausgabe:
    redirecting to systemctl
    redirecting to systemctl
    
    (which means that the installation was correct)

    but then

    Code:
    sudo /etc/init.d/mysql start
    redirecting to systemctl
    Job failed. See system logs and 'systemctl status' for details.
    which I do not know how to deal with it.

    Alex

  10. #10
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,151

    Default Re: Mysql Wipe out all

    But did you
    Code:
    #  rm -r /var/lib/mysql  /usr/share/mysql  /usr/lib64/mysql  /usr/bin/mysql*  /etc/my*   /etc/init.d/mysql
    which removes all of the mysql related scripts before the forced re-installation?

    If so then the next step might be to remove, then re-install systemd.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •