zoukankan      html  css  js  c++  java
  • mac jdbc连接mysql

    1.下载jdbc驱动:

    http://dev.mysql.com/downloads/connector/j/

    2.增加jdbc的jar包至项目的libs文件夹并build path

    2.改动环境变量:export PATH=/usr/local/mysql/bin/:${PATH}

    3.默认root@localhost没有password

    4.改动password:

    命令行:mysqladmin -u root -p  password root

    MYSQL环境中的命令:

    mysql> UPDATE mysql.user SET password=PASSWORD(’新密码’) WHERE User=’root’;

    mysql> FLUSH PRIVILEGES;

    5.重新启动mysql

    /Library/StartupItems/MySQLCOM/MySQLCOM restart

    停止mysql

    /Library/StartupItems/MySQLCOM/MySQLCOM stop

    6.进入test

    mysql -u root -proot

    use test

    7.新建一张測试表

    create table table1 (username varchar(20) primary key,password integer);

    8插入測试数据

    insert into table1 values('yyz',123456);

    insert into table1 values('pengkv',123456);

    insert into table1 values('yjj',123456);

    insert into table1 values('pj',123456);

    insert into table1 values('cl',123456);

    9.书写代码


  • 相关阅读:
    hive sql基础了解
    创建自增字段,修改字段
    flysql 里两种传参的方式
    创建有赞商品资料
    cortable 使用方法
    学会如何使用,pycharm,和gitlanb
    进程和线程
    创建商品资料模板
    SAP 实例 5 CFW Events
    SAP 实例 4 CFW
  • 原文地址:https://www.cnblogs.com/zfyouxi/p/3865951.html
Copyright © 2011-2022 走看看