


mac uses terminal to run mysql, mysql terminal, mysql mac, mysql directory, mysql path, macmysql_PHP tutorial
Jul 13, 2016 am 09:44 AMMac uses the terminal to run mysql, mysql terminal, mysql mac, mysql directory, mysql path, macmysql
First go to the official website to download: http://www.mysql. com/downloads/
I downloaded the dmg of 5.6.11 and installed it. After the installation is completed... If you want to use the terminal to play SQL, then you have to enter a long string at the beginning: /usr/local/mysql/bin/mysql
This is inconvenient. I want to enter mysql -uroot -p1 like in cmd under windows... I checked online. It can be done.
Open the terminal and enter:
1)alias mysql=/usr/local/mysql/bin/mysql
2)alias mysqladmin=/usr/local/mysql/bin/mysqladmin
After execution, you can operate it like windows.
The second one is to set the password
We can enter: mysqladmin -u root password
Open and close MySQL in the terminal:
sudo /Library/StartupItems/MySQLCOM/MYSQLCOM [start | stop | restart]
But there is
in our installation packageMySQL_StartupItem.pkg
MySQL.prefPane
After installation, there will be mysql in the system preferences...
ps: Supplement the above alias method. If you execute it as above, then closing the terminal and reopening it will have no effect. If you want long-term effects, you need to modify the file and let the terminal load it when it starts.
Input in terminal: cd ~
vim ./bash_profile
This file has been modified if the android development environment has been configured. We add 2 lines
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
Save and exit, restart the terminal or open a new window
alias command: Set command alias
alias: usage: alias [-p] [name[=value] ... ]
1. Grammar
alias [parameter][command alias]=[original command name]
2. Function introduction
This command is mainly used to define a new alias for the original command to facilitate writing or memory.
3. Parameter description
Parameter Function Description
-p
Send an existing command alias to the standard output device
[command alias]=[original command name]
Define a command alias, even if you use "alias" instead of "original command name", the actual command used in the end is still the original command
4. Example
4.1 Set command alias
Under ubuntu, we will often use the command
ll
instead of command
ls -al
But there is no such command in mac. So we used alias to implement this function, and added other parameters to make it more convenient for us to use. Execute command
<span>#</span><span> 為了方便看文件或者目錄的大小,加多一個參數(shù)h</span><span> #</span><span> 參數(shù)說明:</span><span> #</span><span> a-顯示隱藏文件</span><span> #</span><span> l-顯示文件的詳細信息</span><span> #</span><span> h-以適合的單位進行文件或者目錄大小的顯示</span> alias ll='ls -alh'
After the command is executed, we execute ll once to try. The console output is as follows:
kevin@uc:~/Downloads/<span>mac$ ll total 173M drwxrwxr</span>-x 2 kevin kevin 4.0K 9月 25 16:20 .<span> drwxr</span>-xr-x 8 kevin kevin 4.0K 9月 29 13:59 .. -rw-rw-r-- 1 kevin kevin 150M 9月 25 16:20 Navicat Premium <span>for</span> Mac 11.0.20 中文版.<span>dmg </span>-rw-rw-r-- 1 kevin kevin 26 9月 25 16:20 Navicat Premium <span>for</span> Mac 11.0.20 中文版.dmg:Zone.<span>Identifier </span>-rw-rw-r-- 1 kevin kevin 12M 9月 3 10:35 synergy-1.5.1-r2398-MacOSX108-x86_64.<span>dmg </span>-rw-rw-r-- 1 kevin kevin 12M 9月 3 10:36 synergy-1.5.1-r2398-MacOSX109-x86_64.dmg
4.2 Display the existing command alias list
alias -p
The console will output the following results:
kevin@uc:~$ alias -p
alias ll='ls -alh'
5. Experience skills
Use this command to simplify some long commands.
When using this command, the user must use single quotes ' ' to surround the original command to prevent special characters from causing errors.
The effect of this command is limited to the login operation. If you want to be able to use these command aliases every time you log in, you can store the corresponding alias commands in the bash initialization file "~/.bash_profile".
6. View the original command of the command alias
To get the original command of the command alias, you can use the command "type" to achieve it, enter the following command:
type ll #Display the original command of the command alias
The console will output:
ll is aliased to `ls -alh'

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Introduction: In this article, this website will introduce to you the relevant content about the Mac keyboard not responding when entering passwords. I hope it will be helpful to you, let’s take a look. How to solve the problem that the password cannot be entered on the Apple Mac system? You can also try to connect this keyboard to other computers to see if it works normally. If the same problem occurs on another computer, it's most likely a fault with the keyboard itself. You may consider replacing the keyboard or repairing it. The first time you log in to Alipay with your Mac computer, you will find the login interface and cannot enter your password. The password input field displays: "Please click here to install the control", so Alipay login requires the installation of security controls. Security controls can encrypt and protect the information you enter (amount, password, etc.) to improve account security. Tie

Preface: Today, this site will share with you the relevant content about installing pkg files on Mac. If it can solve the problem you are facing now, don’t forget to follow this site and start now! The previous version of macos pkg cannot be installed to upgrade the operating system: If your laptop is using an older operating system version, it is recommended to upgrade to the latest operating system version. Because older versions may not support installation of the latest macOS system. Select "Erase" in Disk Utility, then select the Macos extension in the format, do not check the encryption option, and do not select the apfs format, and finally click the "Erase" button to solve the problem of being unable to complete the macOS installation. Drag the application's icon to the file starting with App

Many Mac users tend to keep the default name of their device and may never consider changing it. Many people choose to stick with the name from the initial setup, such as "Johnny's MacBook Air" or simply "iMac." Learning how to change the name of your Mac is a very useful skill, especially when you have multiple devices, as it can help you quickly distinguish and manage them. Next, we will teach you step by step how to change the computer name, host name and Bonjour name (local host name) in macOS system. Why should you change your Mac name? Changing the name of your Mac can not only show your personality, but also help improve the user experience: Personalize your Mac: The default name may not be to your taste, change it to a name you like.

Recently, some friends have consulted the editor about how to set up WeChat Mac to automatically convert voice messages into text. The following is a method for setting up WeChat Mac to automatically convert voice messages into text. Friends in need can come and learn more. Step 1: First, open the Mac version of WeChat. As shown in the picture: Step 2: Next, click "Settings". As shown in the picture: Step 3: Then, click "General". As shown in the picture: Step 4: Then check the option "Automatically convert voice messages in chat to text". As shown in the picture: Step 5: Finally, close the window. As shown in the picture:

By default, iPhone takes photos from the camera in HEIC format. HEIC stands for High Efficiency Image Container and can hold more pixel data than PNG or JPG files, taking up significantly less space on iPhone storage compared to other formats. These files work best on iPhones but are not widely accepted on the internet because they often result in blurry/grainy pictures when you share them with non-Apple devices. To ensure that HEIC images are compatible on other devices, you may need to convert them to JPG format. This article will introduce how to convert HEIC images to JPG on Mac. How to Convert HEIC Photos to JPG on Mac [3 Methods] Method

Introduction: This article will introduce to you the relevant content about the mac configuration file not taking effect. I hope it will be helpful to you, let's take a look. The solution to the problem that environment variables cannot take effect under Mac. After configuring environment variables in the Mac system, it is found that they are only effective in the current terminal and will become invalid once the terminal is switched. After inquiry, it was found that the Mac system is pre-installed with a tool called ultimate shell-zsh, and the reading of environment variables needs to be set in the .zshrc file. 2. In order for our configuration file to take effect, we can only add the above configuration in .zshrc. If you don’t make the above settings, you will find that it will only take effect every time you source ~/.bash_profile. Re-open z next time.

Formatting the drive of your Mac system is crucial for proper functioning. It helps prevent various system problems and makes your Mac more stable overall. While naturally Mac supports various partitioning schemes, GUID offers more modern and versatile features compared to other options. Also essential for newer Macs and supports larger drives, giving you the best compatibility and stability. This guide will take an in-depth look at how to format a drive using a GUID on macOS. That said, let's get started. Why GUID is important for macOS installation A GUID (full form of Globally Unique Identifier) ??is a partitioning scheme that helps install and run the macOS operating system. It is better than traditional MBR (main lead

Ever since the Apple M4-powered OLED iPad Prolineuparrived, Apple Silicon aficionados have been eagerly awaiting the arrival of the M4 SoC on the Mac lineup. The M4 was undeniably a major leap forward in both compute and graphics performance - leapfr
