macOS install mysql 5.7 homebrew

Today I decided to upgrade my MySQL database from 5.6 to 5.7. Previously I was using Bitnami MAMP DB version. Today I decided use homebrew version upgrade my MySQL.

To install MySQL is pretty simple. However, if you installed previous MySQL version before. It will be a challenge for you. My advice is to delete all your old data to avoid running in mysql_upgrade command required by MySQL when you need to run some command related to sys database.

To install MySQL with homebrew is:

You can check what are you going to install via this command.

brew info mysql it will prompt and listed what will be version will be installed. For my today case, it is 5.7.21. Then I confirmed I wanted to install.

brew install mysql

That’s all

If you want to restart MySQL run brew services restart mysql

Please take note that, once you have restarted your mysql. Homebrew will copy /usr/local/Cellar/mysql/your version/homebrew.mxcl.mysql.plist to ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

So whatever you want to edit, please edit on /usr/local/Cellar/mysql/your version/homebrew.mxcl.mysql.plist

Regarding my.cnf

MySQL 5.7 does not have default my.cnf, you also cannot find in the default support-files that ship together. You may just create one at /etc/my.cnf, please take note that not all the setting will be applied via this file.

For example. bind-address. Sometimes it binds together with start process.

More info:- https://dba.stackexchange.com/questions/55958/cant-remote-access-mysql-server-running-on-mac-os-x

Remove old MySQL data in homebrew

ps -ef | grep mysql with this command, you actually can see the mysql process bind to what parameter.

So for my case, mysql datadir=/usr/local/var/mysql, you may delete this one first before you install.

Laravel Multiple Login Logout Password Reset User/Member and Admin Tutorial

When you work in CMS, it is pretty common you have multiple roles and permission.

Setting Up Multi-Authentication in Laravel 5.4+ (Part 1)

Or from Forum

https://laracasts.com/discuss/channels/laravel/password-reset-for-multiple-tables?page=1

However, for my own appoach kind of different from above solution.

I am using subdomain to different out the session. So I do no need to duplicate the controller. I can use the same flow as main domain used.

 

Convert Excel Text Number String to Number for calculating used

I am sure you experience after export from some software. The number treated as String. And you can’t use it for doing calculation.

  1. Copy the data to new sheet or new workbook.
  2. paste in this formular `=IF(ISBLANK(B2),””,VALUE(B2))`
    What this formular do is first check is the cell is it blank or not, if it is blank then show it is blank, else, show the value of that cell (this is the part convert it from string to number)
  3. Next, you just copy and paste the formula accordingly.
  4. Final step, you select all the formular area, then paste it as VALUE.
  5. DONE!

Below example, as you can see the yellow part is original data, it mixed with string and number. The little green arrow on the top left corner indicate you can convert it to other format, but you have to do it one by one.

On the green part is followed by formular converted it to number.

 

Thanks for reading!