Home Database Mysql Tutorial MAC下安装与配置MySQL

MAC下安装与配置MySQL

Jun 07, 2016 pm 03:46 PM
mac mysql download Install Official website access Configuration

一 下载MySQL 访问MySQL的官网http://www.mysql.com/downloads/然后在页面中会看到“MySQL Community Server”下方有一个“download”点击。 进入MySQL的下载界面(http://www.mysql.com/downloads/mysql/),如果你是用的Mac OS来访问的话那么就会默认为你

一 下载MySQL

    访问MySQL的官网http://www.mysql.com/downloads/ 然后在页面中会看到“MySQL Community Server”下方有一个“download”点击。

MAC下安装与配置MySQL

进入MySQL的下载界面(http://www.mysql.com/downloads/mysql/),如果你是用的Mac OS来访问的话那么就会默认为你选好了Mac OS X 平台,而下面罗列的都是在Mac OS上能用的MySQL的版本,如果是用的其他平台,在“Select Platform”选项的下拉列表中选一下就好了。

      在Mac OS上的MySQL的版本很多,其中有按平台来的,比如10.5/10.6等平台,然后有32位的和64位的,这个你按照自己系统的情况来进行选择,然后就是文件的后缀名有.tar.gz的和.dmg的,这里我选择的是.dmg的。点击右侧的download进行下载。

MAC下安装与配置MySQL

       然后会跳转到另外一个界面,这个界面是提示你需不需要注册的,直接选择最下面的“No thanks,just take me to downloads!”,然后这才真正跳转到了下载的界面,这个界面列了很多的供下载的服务器,选择一个服务器进行下载就OK了。

二 安装MySQL

      打开MySQL的安装包:

MAC下安装与配置MySQL

分别安装

mysql-5.5.16-osx10.6-x86_64.pkg:这个是MySql的主要程序包;

MySQL_StartupItem.pkg:MySql的启动项;

MySQL.prefPane:安装完成后会在系统的偏好设置里面出现,是MySQL的偏好设置,里面主要是用来启动MySQL服务的.

 

三 下载安装MySQL Workbench(GUI Tool)

3.1 MySQL Workbench的下载

      访问http://www.mysql.com/downloads/ 在下面有一个MySQL Workbench(GUI Tool)的项,点击其下的DOWNLOAD即可进入下载界面:

MAC下安装与配置MySQL

      然后同样选择版本之后选择服务器进行下载。这里貌似只有一个版本:

MAC下安装与配置MySQL

 

3.2 MySQL Workbench的安装

下载完成之后安装就非常简单,双击即可安装。安装完成之后我们在“应用程序”里面就能看到MySQL Workbench.app程序了。双击打开:

MAC下安装与配置MySQL

到这里MySql Workbench就安装完毕了。

      安装完成之后我们就讲MySQL Workbench连接到MySQL的数据库上,然后对数据库进行管理。

 

3.3 建立一个新连接

      可以看到MySQL Workbench的主界面有三大模块,SQL Development,Data Modeling,Server Administration。其中在SQL Development下面有一个“New Connection”点击之后就会出现一个“Setup New Connection”的对话框,填写完Connetion Name之后点击Ok。即可完成一个连接到本地数据库的连接。

MAC下安装与配置MySQL

   完成之后在主界面的就会出现刚才建立的连接,如下图:

MAC下安装与配置MySQL

 双击连接名或者选中一个连接之后点击“Open Connection to Start Querying”,即可进入这个操作数据库的界面:

MAC下安装与配置MySQL

这些所有的前提都是数据库服务得打开。

 

3.4 管理数据库的访问密码

      MySQL的默认账号密码是root/root,正常情况下我们如果单纯的只是使用MySQL Workbench来管理数据库的这个账号是可以的,但是当我们在编程代码中通过jdbc来访问MySQL时我们就会发现使用这个账号是不行,无法访问,因为MySQL需要我们更改密码,也就是说root这个是个默认的密码也就是弱密码,需要我们修改之后才能在代码中使用。因此我们需要来管理数据库的访问密码。

      新建一个Server Instance

      在“Server Administration”模块下有个“New Server Instance”点击之后会弹出一个“Create New Server Instance Profile”的对话框,跟着对话框的一步一步走就可以完成,一般本地的数据库直接跟着默认设置就ok。完成之后我们就能够在Workbench的主界面最右边看到刚才建立的instance。

 MAC下安装与配置MySQL

双击打开管理器,这里需要密码,一般还没改过的就是root。然后在左侧的菜单栏下有个“SECURITY”下面有个“Users and Privileges”的子菜单项,选择就会看到如下界面:

MAC下安装与配置MySQL

在右侧的面板中有一个User Accounts的列表,选择其中要修改密码的账号,然后在右侧修改密码即可

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MySQL's Role: Databases in Web Applications MySQL's Role: Databases in Web Applications Apr 17, 2025 am 12:23 AM

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

How to start mysql by docker How to start mysql by docker Apr 15, 2025 pm 12:09 PM

The process of starting MySQL in Docker consists of the following steps: Pull the MySQL image to create and start the container, set the root user password, and map the port verification connection Create the database and the user grants all permissions to the database

Laravel Introduction Example Laravel Introduction Example Apr 18, 2025 pm 12:45 PM

Laravel is a PHP framework for easy building of web applications. It provides a range of powerful features including: Installation: Install the Laravel CLI globally with Composer and create applications in the project directory. Routing: Define the relationship between the URL and the handler in routes/web.php. View: Create a view in resources/views to render the application's interface. Database Integration: Provides out-of-the-box integration with databases such as MySQL and uses migration to create and modify tables. Model and Controller: The model represents the database entity and the controller processes HTTP requests.

Solve database connection problem: a practical case of using minii/db library Solve database connection problem: a practical case of using minii/db library Apr 18, 2025 am 07:09 AM

I encountered a tricky problem when developing a small application: the need to quickly integrate a lightweight database operation library. After trying multiple libraries, I found that they either have too much functionality or are not very compatible. Eventually, I found minii/db, a simplified version based on Yii2 that solved my problem perfectly.

How to install mysql in centos7 How to install mysql in centos7 Apr 14, 2025 pm 08:30 PM

The key to installing MySQL elegantly is to add the official MySQL repository. The specific steps are as follows: Download the MySQL official GPG key to prevent phishing attacks. Add MySQL repository file: rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm Update yum repository cache: yum update installation MySQL: yum install mysql-server startup MySQL service: systemctl start mysqld set up booting

Centos install mysql Centos install mysql Apr 14, 2025 pm 08:09 PM

Installing MySQL on CentOS involves the following steps: Adding the appropriate MySQL yum source. Execute the yum install mysql-server command to install the MySQL server. Use the mysql_secure_installation command to make security settings, such as setting the root user password. Customize the MySQL configuration file as needed. Tune MySQL parameters and optimize databases for performance.

Laravel framework installation method Laravel framework installation method Apr 18, 2025 pm 12:54 PM

Article summary: This article provides detailed step-by-step instructions to guide readers on how to easily install the Laravel framework. Laravel is a powerful PHP framework that speeds up the development process of web applications. This tutorial covers the installation process from system requirements to configuring databases and setting up routing. By following these steps, readers can quickly and efficiently lay a solid foundation for their Laravel project.

MySQL vs. Other Programming Languages: A Comparison MySQL vs. Other Programming Languages: A Comparison Apr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

See all articles