Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Major DB Problems Resolved

All,

I installed osTicket and suddenly found it was as though someone erased my entire MySQL database. So I reached out to Customer Care accusing them of a "DROP ALL" mysql statement in the code.

Peter Rotich answered me stating no such thing.  So looked through the code and he was right; no DROP ALL in there.  I next suspected a "purge" & "re-install" of MySQL, but could not find that.  Next I suspected some corruption, but again nothing.

Finally I found that I could neither login via phpMyAdmin with either my admin or root UID/PWD combo.  I then, not being a DBA, had to read through loads and loads of crap to find the following bash script solution to resetting my root password:

root_reset.sh
#! /bin/bash
# Script to reset the MySQL root password

rst_file="/Scripts/MySQL/root-reset.txt";
/etc/init.d/mysql stop;
mysqld --skip-grant-tables --skip-networking < $rst_file;
/etc/init.d/mysql restart;
exit;

root-reset.txt
/* Reset the Root PWD */
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'mypass';
FLUSH PRIVILEGES;

/* Create addition Admin user with root permissions */
CREATE USER '$user'@'localhost' IDENTIFIED BY 'mypass';
GRANT ALL PRIVILEGES ON *.* TO '$user'@'localhost' WITH GRANT OPTION;
CREATE USER '$user'@'%' IDENTIFIED BY 'mypass';
GRANT ALL PRIVILEGES ON *.* TO '$user'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
QUIT;
It was amazing! As soon as the root password was reset I could suddenly see all my DBs and Tables.

So the crime committed by the dev team was to reset the root password to their own which locks the user out of all their DBs/Tables.

If you run into this problem, this is the solution!

Cheers!

OMR

Comments

  • So first and foremost this does not appear to be a "Suggestion and Feedback" post.  I'm going to move it to General Discussion.

    "I installed osTicket and suddenly found it was as though someone erased my entire MySQL database."

    Which version did you install, and where did you get it from?

    "So the crime committed by the dev team was to reset the root password to their own which locks the user out of all their DBs/Tables."

    In  the 100s of installs and upgrades that I have performed I have never ever seen this. osTicket does not even setup a DB user in the database, and it certainly does not update the password of privs of any existing users.  The system admin (read that as you) has to setup the user and password at the database level before you can even install.

    As a side note the scripts the you ran do a lot more then "reset the root password".  It resets root@localhost password [but not from any other host, just localhost].  It also creates a localhost user, and grants ALL privs to every database to it.  It then creates extends the users access the db service from anywhere and grants ALL privs to every database to it.  I made the anywhere bold because that sort of wildcard access is generally considered a security concern.
Sign In or Register to comment.