Posts

Showing posts with the label default

Fix mysql ERROR 1698 (28000): Access denied for user 'root'@'localhost'

After a fresh install of MariaDB on a Ubuntu 16.04 machine, I got this error when trying to login to mysql: $ mysql -u root -p ERROR 1698 (28000): Access denied for user 'root'@'localhost' Then I realized that I can login without password if I use sudo (of-course I have to enter the sudo password): $ sudo mysql -u -p So I's looking around on the Internet and figure out the problem. In Ubuntu 16.04, mysql is using by default the UNIX auth_socket plugin which means that db users will be authenticated by the system user credentials. $ sudo mysql -u root mysql> USE mysql; mysql> SELECT User, Host, plugin FROM mysql.user; +--------------+-------------------+ | User            | plugin                | +--------------+-------------------+ | root             | auth_socket       | So to login to mysql without sudo and use the password, I have to set the...

How to make the Atto editor of Moodle always expanded

Image
Be default the Atto HTML editor is collapsed. It would  be helpful if we can make it expanded so the users don't have to click the Show/Hide button all the time. And here is how: Go to Site administration  > Plugins  > Text editors  > Atto HTML editor  > Atto toolbar settings , scroll to the Toolbar config box and remove the setting ' collapse = collapse '. Save the changes.

How to restore the nginx.conf to default

Sometimes you mess up the nginx.conf of your server just like me a couple days ago, and want to go back to default. Here is how to do it: 1. Move the current nginx.conf to somewhere else or change its name: $ sudo mv /etc/nginx/nginx.conf /etc/nginx/nginx.bk 2. Restore the default nginx.conf using the " force-confmiss " option of dpkg: $ sudo dpkg --force-confmiss -i /var/cache/apt/archives/nginx-common_*.deb 

MySQL does not start automatically at system startup/reboot in Ubuntu 14.04

For some reason, after the Ubuntu 14.04 server rebooted, my MySQL service did not start automatically. So I decided to restore the default upstart script of MySQL and everything's back to normal now: $ sudo update-rc.d mysql defaults