Reset the MariaDB Root Password

If you forget your root MariaDB password, it can be reset.

  1. Stop the current MariaDB server instance, then restart it with an option to not ask for a password:
    sudo systemctl stop mariadb
    sudo mysqld_safe --skip-grant-tables &
  2. Reconnect to the MariaDB server with the MariaDB root account:
    mysql -u root
  3. Use the following commands to reset root’s password. Replace password with a strong password:
    use mysql;
    update user SET PASSWORD=PASSWORD("password") WHERE USER='root';
    flush privileges;
  4. Then restart MariaDB:
    sudo systemctl start mariadb

Ketika MacBook-mu loop boot Setelah Update OSX, Backup data-mu dengan langkah ini

Ini gw alami ketika update OSX via online. Gw gatau kenapa dia boot-loop dan dalam posisi loading… yang ga berkesudahan. Udah coba restart dan shutdown berulang2 juga ga ngaruh. Coba bawa ke MacArena di Ambassador Plaza, malah ditawarin format dan install ilang dengan konsekuensi data gw ilang dan ga bisa diselamatin plus bayar 250rb perak. Ogah donk gw wkwkwk..
Ya udah, gw balik kanan, lalu lanjutin googling lagi, dan nemuin banyak artikel menarik. Jadi saran gw ketika lo nemuin masalah dalam hidup lo (eaaaa…) lo googling aja, karena lo ga sendiri dan orang lain udah pernah ngalamin sebelum elo..

Okok.. gw dah banyak bacot diatas.. ini gw pastein langkahnya..

We are using OS X El Capitan. Earlier OS X versions have slightly different interface. 

1-Connect your external hard drive to your Mac (yes you need an external hard disk). Make sure this drive has enough spare disk space to store your backup files.

2-Boot your Mac into Recovery Mode. Follow the steps to do this:

  • Shut down your Mac
  • Restart your Mac and hold down the Command and R keys immediately after you hear the startup chime.  Keep holding them until you see the Apple logo.
  • Wait until you see the OS X Utilities windows
  • Select Disk Utility and click Continue

Disk Utility

  • Select the Disk you want to back up, such as Macintosh HD

Macintosh HD

  • Select File > New Image > Image from “Macintosh HD or Your Drive”

system image of Mac

  • You may change its name, if you want to

back up disk utility

  • Select your external drive
  • Choose “compressed”
  • Select Save
  • Your backup process will start. It may take some time.

3- You will notified you when the process is done.

If you get a new Mac, and want to restore your back up, you may use Migration Assistant transfer the data back to your Mac.

Making backups of your files is important. Before losing anything, back up now. You may want to use the OS X Time Machine feature to easily create back up files. That is the easiest way to back up your Mac. You may also use iCloud to back up some of your files like musics, photos etc.

How to Install PHP 7.x on CentOS 7

Step 1: Setup the Webtatic YUM repo

Precompiled PHP 7.x binaries are available for CentOS 7 from the WebtaticIUS, or Remi’s RPM repositories.

Below are instructions on installing PHP 7.x using the Webtatic YUM repo.

Setup the Webtatic YUM repo:

sudo rpm -Uvh
sudo rpm -Uvh

Step 2: Install PHP 7.1 and necessary extensions

Install PHP 7.1 and some of the most commonly used extensions:

sudo yum install -y mod_php71w php71w-cli php71w-common php71w-gd php71w-mbstring php71w-mcrypt php71w-mysqlnd php71w-xml

Note: The above packages are for general purpose use and may not suit your specific requirements. You should confirm the packages to be installed referring to the Webtatic PHP 7.1 introduction page.

Alternatively, if you want to install PHP 7.0, you should refer to Webtatic PHP 7.0 introduction page.

Step 3: configure PHP 7.x

After the installation, the PHP 7.x configuration file will be saved as /etc/php.ini. If necessary, you can use the vi text editor to modify it:

sudo cp /etc/php.ini /etc/php.ini.bak
sudo vi /etc/php.ini

Remember to restart your web server after modifying the /etc/php.ini file.

For Apache:

sudo systemctl restart httpd.service

For Nginx:

sudo systemctl restart nginx.service php-fpm.service

That’s it. Thanks for reading.

Update WP

  1. Get the latest WordPress zip (or tar.gz) file.
  2. Unpack the zip file that you downloaded.
  3. Deactivate plugins.
  4. Delete the old wp-includes and wp-admin directories on your web host (through your FTP or shell access).
  5. Using FTP or your shell access, upload the new wp-includes and wp-admin directories to your web host, in place of the previously deleted directories.
  6. Upload the individual files from the new wp-content folder to your existing wp-content folder, overwriting existing files. Do NOT delete your existing wp-content folder. Do NOT delete any files or folders in your existing wp-content directory (except for the one being overwritten by new files).
  7. Upload all new loose files from the root directory of the new version to your existing wordpress root directory.

Reset MySQL Root Password on CentOS 7

1. Stop mysql:
systemctl stop mysqld

2. Set the mySQL environment option 
systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"

3. Start mysql usig the options you just set
systemctl start mysqld

4. Login as root
mysql -u root

5. Update the root user password with these mysql commands
mysql> UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword')
    -> WHERE User = 'root' AND Host = 'localhost';
mysql> quit

6. Stop mysql
systemctl stop mysqld

7. Unset the mySQL envitroment option so it starts normally next time
systemctl unset-environment MYSQLD_OPTS

8. Start mysql normally:
systemctl start mysqld

Try to login using your new password:
7. mysql -u root -p