MacPorts:Install and configure MySQL 5

macport相当于linux下的yum或者是aptget等包管理软件,可以很方便的安装软件。下面来看一下他的基本命令

基本命令:mac port command

转自:http://www.joycodes.com/index.php/mac-port-update-command/

 

* 更新port自身


sudo port selfupdate

* 列表


post list


* 搜索包


port search package #package为搜 索名称,支持通配符

* 安装


sudo port install package

* 删除

sudo port uninstall package

* 更新过期的包



sudo port upgrade outdated

* 删除为激活的包


sudo port uninstall inactive

有关port的命令还有很多,详情请参考http://guide.macports.org/

 

===========

 

Install and configure MySQL 5 with MacPorts

转自:http://beike.iteye.com/blog/617341

I decided to move my MySQL server installation from the server I installed from MySQL .com to macports. Why? I believe MacPorts will simplify future upgrades. I'd also like to keep my LAMP installs in the same location. If you haven't already, install and configure MacPorts . Here are the steps I'll go over:

  • Intall MySQL 5
  • Create the initial MySQL databases
  • Options for starting MySQL
  • Confirm that MySQL is running
  • Set Basic MySQL Security

Install MySQL 5

You can install using Porticus, Port Authority, or from the command line:

  1. sudo  port  install  mysql5 +server  
 

 

The +server variant is required if you'll need to create a system startup item for MySQL 5. You'll see plenty of output during the build process and an activation message just before the installation completes.

Create initial MySQL databases

MySQL databases are kept in /opt/local/var/db/mysql5/ and you'll notice that this directory is empty. Run mysql_install_db to create the mysql and test databases.

  1. sudo  /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql    
 

Password:

You should see output similar to the following:

  1. nstalling MySQL  system tables...  
  2. OK  
  3. Filling help tables...  
  4. OK  
  5.   
  6. To start mysqld at boot time you have to copy  
  7. support-files/mysql .server to the right place for your system  
  8.   
  9. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL  root USER !  
  10. To do so, start the server, then issue the following commands:  
  11.   
  12. /opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password'   
  13. /opt/local/lib/mysql5/bin/mysqladmin -u root -h MacBook.local password 'new-password'   
  14.   
  15. Alternatively you can run:  
  16. /opt/local/lib/mysql5/bin/mysql_secure_installation  
  17.   
  18. which will also give you the option of removing the test  
  19. databases and anonymous user created by default.  This is  
  20. strongly recommended for production servers.  
  21.   
  22. See the manual for more instructions.  
  23.   
  24. You can start the MySQL  daemon with:  
  25. cd /opt/local ; /opt/local/lib/mysql5/bin/mysqld_safe &  
  26.   
  27. You can test the MySQL  daemon with mysql -test-run.pl  
  28. cd /opt/local/mysql -test ; perl mysql -test-run.pl  
  29.   
  30. Please report any problems with the /opt/local/lib/mysql5/bin/mysqlbug script!  
  31.   
  32. The latest information about MySQL  is available at http://www.mysql .com/  
  33. Support MySQL  by buying support/licenses from http://shop.mysql .com/  

 

Options for starting MySQL

I personally don't want MySQL to start at system start up, I'll start it manually when I need it. If you're energy conscious and set your Mac to go to sleep you won't want to set mysqld to start at system boot either. If, however, you need MySQL to always start at system boot

sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist

  1. sudo  launchctl load -w  /Library/LaunchDaemons/org.macports.mysql5.plist  
 

 

Whether you install the startup item or not, it's handy to add aliases to your profile to start and stop mysql from the command line. Use your favorite text editor (vi, pico, emacs) to add aliases.

vi ~/.profile

or

vi ~/.bash_profile

Add the following:

  1. alias mysqlstart= 'sudo /opt/local/bin/mysqld_safe5 &'
  2. alias mysqlstop= '/opt/local/bin/mysqladmin5 -u root -p shutdown'
 

Note: Notice the '5' at the end of mysqld_safe? MacPorts adds version numbers at the end of executables to allow the installation of multiple versions (i.e. MySQL 4 and 5). You'll need to add the version number at the end of some of the executables you use, like mysqladmin5. Now you're ready to start your MySQL server with:

mysqlstart

or, if you didn't create aliases

sudo /opt/local /share/mysql5/mysql /mysql .server start

Confirm that MySQL is running

If MySQL 's okay, you should see a server start confirmation message. You can test to ensure that MySQL is running with (leave password empty when prompted):

mysqladmin5 -u root -p ping  Enter password:  mysqld is alive

or with

mysql5 -u root -p Enter password:  

Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 2 to server version: 5.0 .45  Type 'help;' or '\h ' for help . Type '\c ' to clear the buffer.

If you get the following error...

ERROR 2002 ( HY000) : Can't connect to local MySQL server through socket ' /tmp/mysql .sock' (2)

...set the mysqld_safe socket path in a new MySQL configuration file. Create /opt/local/etc/mysql5/my.cnf, add the following to it, save, the try again.

[ mysqld_safe] socket = /tmp/mysql .sock

NOTE: If you've installed MacPort's PHP 5 you will probably need to tell PHP where the MySQL socket is. Edit your php.ini file located at /opt/local/etc/php.ini.

mysql .default_socket = /tmp/mysql .sock

Set Basic MySQL Security

Finally, set the root mysql password to secure your server.

mysqladmin5 -u root password

Moving MySQL data from other installations

If, like me, you want to move data from a previous MySQL 5 install (i.e. /usr/local/mysql /data), be sure to stop MySQL first. You'll want to overwrite the mysql database you created after installation when copying over data files and indices. Ensure that everything copied to /opt/local/var/db/mysql5/ remains owned by mysql . Refer to the MySQL documentation if you're upgrading from MySQL 4 to 5.

Now get busy querying.

jsprit 是一个基于 Java 的开源工具包 jsprit 是一个基于 Java 的开源工具包,用于解决复杂的 旅行商问题 (TSP) 和 车辆路径问题 (VRP)。 它轻量、灵活且易于使用,基于单一的通用 元启发式算法,目前可解决以下问题: 带容量约束的车辆路径问题 (Capacitated VRP) 多 depot 车辆路径问题 (Multiple Depot VRP) 带时间窗的车辆路径问题 (VRP with Time Windows) 带回程的车辆路径问题 (VRP with Backhauls) 带取送货的车辆路径问题 (VRP with Pickups and Deliveries) 带异构车队的车辆路径问题 (VRP with Heterogeneous Fleet) 时间依赖型车辆路径问题 (Time-dependent VRP) 旅行商问题 (Traveling Salesman Problem) 拨号乘车问题 (Dial-a-Ride Problem) 上述各类问题的多种组合 立即下载

相关推荐

2003-2025年 政府创新补贴与非创新补贴 xlsx

整理了A股上市公司的政府补助微观样本,核心涵盖股票代码、公司简称、年份、创新补助总额及非创新补助总额五大关键变量,企业研发创新的专项补助与其他非创新类补助。参考郭玥(2018)《政府创新补助的信号传递机制与企业创新》一文的方法论与分类标准,通过关键词检索与明细人工核对相结合的方式,从繁杂的年度补助明细中精准剥离出创新与非创新补助,对数据进行了校验与异常值剔除。 指标 股票代码 公司简称 年份 创新补助总额 非创新补助总额

【mysql】Mac下安装mysql5.7 完整步骤,大坑已解决

最近使用Mac系统,准备搭建一套本地web服务器环境。因为Mac系统自带PHP和apach,但是没有自带mysql,所以要手动去安装mysql,本次安装mysql最新版5.7.17。 1.官网下载 官网下载地址 点击上面的地址,会看到如下图的页面。你可能不知道该下载哪一个,我下载的是最后一个,就是图中标注红色的那个按钮,为什么?因为它是d...

weixin_34040079的博客 4143

配合上述本地模型资源文件

配合上述本地模型资源文件

在windows和centos系统中搭建PHP7开发环境

在win7环境上安装:一:准备软件:1.下载:php-7.1.16-Win32-VC14-x64.zip 地址:http://php.net/downloads.php2.下载:apache2.4:httpd-2.4.33-o102o-x64-vc14-r2.zip 地址:http://httpd.apache.org/download.cgi注意:Apache2.2中是不支持php7的,...

kunzai6的博客 1522

三电平维也纳VIENNA双闭环控制整流器仿真(Simulink仿真实现)

内容概要:本文档系统性地介绍了以“三电平维也纳VIENNA双闭环控制整流器”为核心的电力电子系统Simulink仿真资源,聚焦于电压电流双闭环控制、中点电位平衡、空间矢量脉宽调制(SVPWM)等关键技术的建模与实现。资源包不仅提供完整的仿真模型,还配套Mathcad计算书、设计报告及参考文献,帮助用户从理论推导到参数设计再到仿真验证实现全流程贯通。同时,文档整合了大量相关拓扑(如DAB、LLC、PFC、CLLC等)与先进控制策略(如EPS调制、软开关、最小应力优化、模型预测控制等)的仿真案例,覆盖从基础整流器到复杂双向变换系统的多个典型应用场景,构成一个面向科研、教学与工程实践的综合性学习体系。; 适合人群:具备电力电子、自动控制或电气工程等相关专业背景,熟悉MATLAB/Simulink仿真环境,正在从事新能源变换、电能质量治理、电机驱动或电力系统方向研究的研究生、高校教师及企业研发工程师。; 使用场景及目标:①开展三电平VIENNA整流器、双有源桥DAB、LLC谐振变换器等先进拓扑的科研建模与论文复现;②完成课程设计、毕业设计或实际工程项目中的控制器开发与系统性能验证;③深入掌握双闭环控制架构、中点电位平衡机制、SVPWM调制策略及系统稳定性分析等核心知识点; 阅读建议:建议结合Mathcad计算书进行系统参数设计,理解控制算法的数学基础,并在Simulink中逐步搭建与调试模型,注重理论计算与仿真结果的对比分析,推荐按照资源目录顺序循序渐进学习,以建立完整的知识框架和技术实现能力。

三相充电桩维也纳PFC+三电平LLC谐振变换器三电平PSIM仿真设计(Simulink仿真实现)

内容概要:本文档聚焦于电力电子与电力系统领域的仿真设计,重点围绕三相充电桩中维也纳PFC(Vienna Power Factor Correction)整流器与三电平LLC谐振变换器的联合系统展开,提供基于PSIM和Simulink平台的完整仿真设计方案。内容涵盖9kW三相三开关维也纳PFC整流器的Mathcad计算书、双闭环控制策略、中点电压均衡控制、SVPWM调制技术及电流过零畸变消除方法等关键技术环节,并配套详细的仿真模型与设计报告。此外,文档整合了丰富的电力电子拓扑资源,包括图腾柱PFC、交错并联PFC、双有源桥DAB、CLLC谐振变换器、双向Buck-Boost等典型电路结构,覆盖Matlab/Simulink、Plecs、PSIM等多种仿真环境,形成从理论计算、建模、控制算法设计到性能优化的一体化技术体系。; 适合人群:面向具备电力电子、电气工程、自动化等相关专业背景,熟悉Matlab/Simulink/PSIM等仿真工具,从事新能源汽车充电技术、高效率AC-DC/DC-DC变换器设计、电力系统能量管理等方向的研究生、科研人员及工程技术人员。; 使用场景及目标:①支持三相高功率因数校正与高效DC-DC变换系统的科研仿真与教学实践;②用于PI控制、前馈控制、SVPWM、软开关技术、中点电位平衡、双闭环动态响应等核心控制算法的研究与验证;③服务于毕业设计、科研课题、学术论文复现及实际工程项目开发,提升系统级建模与优化能力。; 阅读建议:建议结合Mathcad计算书与仿真模型同步学习,优先掌握维也纳PFC与LLC的基本工作原理与参数设计流程,再深入理解双闭环控制系统架构与关键控制策略,推荐先运行Simulink模型观察动态波形响应,并参考附带文献深化理论认知与工程实现能力。

macport mysql_Mac系统中使用MacPorts安装MySQL

1.安装MacPortsMacPorts前称DarwinPorts,是一个软件包管理系统,用来简化Mac OS X和Darwin操作系统上软件的安装。到这个网站下载MacPorts,并安装2.使用Mac安装MySQLsudo port -v install mysql5-server mysql5如果安装成功,会有以下输出:...If this is a new install, in order...

weixin_32009809的博客 501

政府科技管理者在推动科技成果转移转化时,如何高效识别具有高转化价值的科研成果.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

linux、mac 安装mysql

1、安装依赖库 yum -y update 2、添加MySQL YUM仓库 wget http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm rpm -Uvh mysql-community-release-el6-5.noarch.rpm 3、添加/etc/yum.repos.d/mysql-community

命里有时终须有 、博客 4089

国央企创新负责人在推动内部技术转化时,如何高效识别优质专利资源?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

产业园区在推动科技成果转化时,如何精准匹配企业与技术供给方?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

macport mysql_MacPorts:Install and configure MySQL 5

I decided to move my MySQLserverinstallation from the server Iinstalled from MySQL.com to macports. Why? Ibelieve MacPorts willsimplify future upgrades. I'd also like to keep my LAMP installs in thesa...

weixin_36335903的博客 193

849d2910791d3ac603e873835a8296fc_7513595024160782007_m.zip

849d2910791d3ac603e873835a8296fc_7513595024160782007_m.zip

Install and configure MySQL 5 with MacPorts

Install MySQL 5 You can install using Porticus, Port Authority, or from the command line: ? sudo port install mysql5 +server The +server variant is required if you'll

artwebs 1801

高校技术转移办公室人员如何提升技术成果的市场对接效率?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

国央企创新负责人如何借助平台实现技术供需的智能匹配与高效对接?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

macports 2.3.1 安装mysql 报错_Install and configure MySQL 5 with MacPorts

Install and configure MySQL 5with MacPortsI decided to move my MySQL server installation from the server Iinstalled from MySQL.com to macports. Why? I believe MacPorts willsimplify future upgrades. I'...

weixin_32821257的博客 138

海康机器人ID5000 系列智能读码器(三)

又過了兩個月,漸漸的對這個攝像頭的功能更加熟悉了,而實際上,我要做的功能也越來越複雜,從一開始的讀碼,到後來的通過讀二維碼控制設備,再到未讀到二維碼控制設備等,下面就對具體的細項做一個總結。了解完這些就能對ID5000這個設備,乃至很多海康的設備都能做一個二次開發。

qq_54359036的博客 3073
上一篇: xcode iphone 联机调试
下一篇: MAVEN2实用指南, maven2权威指南中英
xiaoxinphp
博客等级 码龄18年 1粉丝 45原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值