FreeBSD 安装mysql
我想在系统里装上mysql
下面是安装步骤: cd /usr/ports/databases/mysql51-server/ make make install make clean cd work/mysql-5.1.11-beta scripts/mysql_install_db 出现以下信息: 引用: |
Installing all prepared tables Fill help tables To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/local/bin/mysqladmin -u root password 'new-password' /usr/local/bin/mysqladmin -u root -h freeBSD.domain password 'new-password' See the manual for more instructions. NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run the /usr/local/bin/mysql_fix_privilege_tables. Otherwise you will not be able to use the new GRANT command! You can start the MySQL daemon with: cd /usr/local ; /usr/local/bin/mysqld_safe & Please report any problems with the /usr/local/bin/mysqlbug script! The latest information about MySQL is available on the web at Support MySQL by buying support/licenses at |
mysql
引用: |
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) |
mysql服务启动不了. : (
引用: |
/usr/local/bin/mysqld_safe & |
也是和上面一样的错误
/usr/local/bin/mysql_install_db --user=mysql试试
以前在LINUX下安装MYSQL的时候 还在烦怎么设置呢.
装好这个PORTS的时候.. 我就直接在rc.conf中 mysql_enable="YES" 然后,/usr/local/etc/rc.d/mysql-server start你 clean 后就没有 work 这个目录了!
所以,你得执行这个去建立 MySQL 的系统数据库: 代码: |
# /usr/local/bin/mysql_install_db |
然后就可以开 MySQL 的数据库服务了:
代码: |
# /usr/local/etc/rc.d/mysql-server onestart Starting mysql. |
FreeBSD提供了一个很强大的安装工具Ports,这个工具可以自己检查安装项的依赖关系。不过遗憾的是,默认是从国外下载安装,速度慢的惊人。为了改善这种情况我们可以使用国内镜像来让Ports从国内下载安装包。
本人推荐使用axel下载,这个工具支持多线程下载和断点续传。配置axel下载需要先保证计算机中有axel工具,如果没有安装,可以在/usr/ports/ftp/axel位置安装,方法同安装其他工具一样。
#cd /usr/ports/ftp/axel
#make install clean
安装完axel后,可以修改make.conf文件,指定axel为下载工具。
#vi /etc/make.conf
插入:
FETCH_CMD=axel -n 30 // -n 30 代表你使用多少个线程下载
DISABLE_SIZE=yes // 建议设置为yes
插入下面几行来使用国内镜像
MASTER_SIDE_OVERRIDE=
/
/
/
/
FreeBSD 挂载移动硬盘
<1>
SCSI设备的,所以当然你的内核得加上SCSI / USB 和 USBMass驱动才可以。<2>
这样,至少你的内核文件中至少就该有如下选项: === # SCSI peripherals # SCSI 相关选项 device scbus # SCSI 总线支持 (必须) device ch # SCSI media changers device da # SCSI 磁盘支持 (必须)# USB support # USB 相关选项
device uhci # UHCI PCI->USB USB接口 (必须) device ohci # OHCI PCI->USB USB接口 device usb # USB 总线支持 (必须) device ugen # Generic#device ehci # USB 2.0总线支持,根据你的需要
device umass # USB块存储设备驱动 ===如果你需要真正能够使用这些设备的话,可能还需要加上这些以支持NTFS和FAT文件系统:
=== options NTFS options MSDOSFS ===<3>
使用下列命令编辑内核配置文件,并编译新内核: # vi /sys/i386/conf/GENERIC # 添加或修改上段所写的选项 # cd /sys/i386/conf # config GENERIC # 生成内核配置选项 # cd ../compile/GENERIC # make depend && make install # 编译和安装内核 # reboot # 重新引导<4>
如果以上几个步骤都没出错的话,那么你走运了,现在你应该可以使用优盘之类的设备了,不过还是先确认一下: # dmesg |grep umass # dmesg |more在上面两条指令后,你至少可以看到这样的一段信息:
=== uhci0: <Intel 82801BA/BAM (ICH2) USB controller USB-A> port 0xa400-0xa41f irq 9 at device 31.2 on pci0 usb0: <Intel 82801BA/BAM (ICH2) USB controller USB-A> on uhci0 usb0: USB revision 1.0 uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered umass0: Genesys Logic USB TO IDE, rev 2.00/0.02, addr 2 ===如果你看到了umass0这一行,那么现在就插入你的USB移动硬盘,优盘,或是DC ~_*
插入之后,应该会立刻在控制台上显示一段很显眼的提示: === da0 at umass-sim0 bus 0 target 0 lun 0 da0: <IC25N020 ATCS04-0 0811> Fixed Direct Access SCSI-0 device da0: 1.000MB/s transfers da0: 19077MB (39070080 512 byte sectors: 255H 63S/T 2432C) (da0:umass-sim0:0:0:0): READ(6)/WRITE(6) not supported, increasing minimum_cmd_ size to 10. === 上面是偶的IBM移动硬盘用ls /dev/da0* 查看有没有出现 da0s1 ,da0s2 ,da0s3
<5> 然后,就可以直接mount这些设备: # mount -t msdos /dev/da0s1 /usb1# mount -t ntfs /dev/da0s1 /usb1
设备名一般是/dev/da0s1 <2/3/4...>,按照你的USB设备分区依次。
使用完之后别忘了先umount掉设备之后在拔掉哦,不然和在Windows下一样会得到一个警告提示的,一不 小心也会丢数据。<6>
FreeBSD目前支持以下USB存储设备,如果你对USB系统熟悉的话,也可以自己添加或移植驱动。 (包含几乎全部闪盘,移动硬盘,记忆棒,大多数的USB CDROM/MO,和一些DC,MMC和SD未测试)===
ADTEC Stick Drive AD-UST32M, 64M, 128M, 256M Denno FireWire/USB2 Removable 2.5-inch HDD Case MIFU-25CB20 FujiFilm Zip USB Drive ZDR100 USB A GREEN HOUSE USB Flash Memory ``PicoDrive'' GH-UFD32M, 64M, 128M IBM 32MB USB Memory Key (P/N 22P5296) IBM ThinkPad USB Portable CD-ROM Drive (P/N 33L5151) I-O DATA USB x6 CD-RW Drive CDRW-i64/USB (CDROM only) I-O DATA USB CD/CD-R/CD-RW/DVD-R/DVD-RW/DVD-RAM/DVD-ROM Drive DVR-iUH2 (CDROM, DVD-RAM only) Iomega USB Zip 100Mb (primitive support still) Iomega Zip750 USB2.0 Drive Keian USB1.1/2.0 3.5-inch HDD Case KU350A Kurouto Shikou USB 2.5-inch HDD Case GAWAP2.5PS-USB2.0 Logitec USB1.1/2.0 HDD Unit SHD-E60U2 Logitec Mobile USB Memory LMC-256UD Logitec USB Double-Speed Floppy Drive LFD-31U2 Logitec USB/IEEE1394 DVD-RAM/R/RW Unit LDR-N21FU2 (CDROM only) Matshita CF-VFDU03 floppy drive MELCO USB2.0 MO Drive MO-CH640U2 I-O DATA USB/IEEE1394 Portable HD Drive HDP-i30P/CI, HDP-i40P/CI MELCO USB Flash Disk ``PetitDrive'', RUF-32M, -64M, -128M, -256M MELCO USB2.0 Flash Disk ``PetitDrive2'', RUF-256M/U2, -512M/U2 MELCO USB Flash Disk ``ClipDrive'', RUF-C32M, -C64M, -C128M, -C256M, -C512M Microtech USB-SCSI-HD 50 USB to SCSI cable NOVAC USB2.0 2.5/3.5-inch HDD Case NV-HD351U Panasonic floppy drive Panasonic USB2.0 Portable CD-RW Drive KXL-RW40AN (CDROM only) RATOC Systems USB2.0 Removable HDD Case U2-MDK1, U2-MDK1B Sony Portable CD-R/RW Drive CRX10U (CDROM only) TEAC Portable USB CD-ROM Unit CD-110PU/210PU Y-E Data floppy drive (720/1.44/2.88Mb)FreeBSD 5.1支持的USB控制器
=== ALi Aladdin-V AMD-756 CMD Tech 670 & 673 Intel 82371SB (PIIX3) Intel 82371AB and EB (PIIX4) Intel 82801AA (ICH) Intel 82801AB (ICH0) Intel 82801BA/BAM (ICH2) Intel 82443MX NEC uPD 9210 OPTi 82C861 (FireLink) SiS 5571 VIA 83C572 USB 其它 UHCI 或 OHCI 兼容主板支持的USB HUB设备
删除挂载, umount /usb1 或者 umount -l