mysql

Web全栈~30.JDBC

一曲冷凌霜 提交于 2021-02-05 22:44:19
Web全栈~30.JDBC 上一期 JDBC: JDBC(Java DataBase Connectivity, Java数据库连接) ,是一种用于执行SQL语句的Java API,为多种关系数据库提供统一访问,它由一组用Java语言编写的类和接口组成。有了JDBC,程序员只需用JDBC API写一个程序,就可访问所有数据库。 SUN公司是规范制定者,制定了规范JDBC(连接数据库规范) DriverManager类 作用:管理各种不同的JDBC驱动 Connection接口 Statement接口和PreparedStatement接口 ResultSet接口 数据库厂商微软、甲骨文等分别提供实现JDBC接口的驱动jar包 程序员学习JDBC规范来应用这些jar包里的类。 JDBC访问数据库的步骤: 加载一个Driver驱动 创建数据库连接(Connection) 创建SQL命令发送器Statement 通过Statement发送SQL命令并得到结果 处理结果(select语句) 关闭数据库资源ResultSet Statement Connection 加载Driver驱动 使用反射加载驱动,其实就是获得一个类的字节码,在获得类的字节码的过程中,一定会加载类进入内存,一旦进入内存会执行代码中的静态代码块,一执行代码块,就会自动的向DriverManager中注册一个驱动

mysql_异常_01_Access denied for user 'root'@'192.168.1.13' (using password: YES)

点点圈 提交于 2021-02-05 20:29:34
mysql_异常_01_Access denied for user 'root'@'192.168.1.13' (using password: YES) 参考文章: (1)mysql_异常_01_Access denied for user 'root'@'192.168.1.13' (using password: YES) (2)https://www.cnblogs.com/shirui/p/8633763.html 备忘一下。 来源: oschina 链接: https://my.oschina.net/u/4438370/blog/4947422

sqoop 从mysql 导入数据到hbase

不羁的心 提交于 2021-02-05 20:25:47
环境: 软件 版本 备注 Ubuntu 19.10 sqoop 1.4.7 mysql 8.0.20-0ubuntu0.19.10.1 (Ubuntu) hbase 2.2.4 必须启动 hadoop 3.1.2 必须启动 hive 3.0.0 之所以和hive有关系是因为需要在.bashrc中设置HCAT_HOME accumulo 2.0.0 需要配合sqoop在.bashrc中设置ACCUMULO_HOMT 数据导入目标: mysql数据------------->Hbase ############################################################################## 准备MYSQL数据集: mysql> create database sqoop_hbase; mysql> use sqoop_hbase; mysql> CREATE TABLE book( -> id INT(4) PRIMARY KEY NOT NULL AUTO_INCREMENT, -> NAME VARCHAR(255) NOT NULL, -> price VARCHAR(255) NOT NULL); 插入数据集 mysql> INSERT INTO book(NAME, price) VALUES('Lie Sporting',

sqoop 报 Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR 解决方法

杀马特。学长 韩版系。学妹 提交于 2021-02-05 19:30:29
Sqoop导入mysql表中的数据到hive,出现如下错误: ERROR hive.HiveConfig: Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly. 方法1: 解决方法: 往/etc/profile最后加入 export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HIVE_HOME/lib/* 然后刷新配置,source /etc/profile 方法2: 将hive 里面的lib下的hive-exec-**.jar 放到sqoop 的lib 下可以解决以下问题。 来源: oschina 链接: https://my.oschina.net/xiaominmin/blog/4947382

Unable to stop MySQL on OS X 10.10

ぃ、小莉子 提交于 2021-02-05 18:58:26
问题 I'm starting to go nuts over this. I setup MySQL/Apache/PHP using the tutorial by Coolest Guides On The Planet. I'm guessing something went wrong as its not working as expected so I want to uninstall and try again. The trouble is that I can't stop MySQL either by system preferences or command line. I keep trying suggestions on the net but so far unsuccessful. Can anyone help? 回答1: Finally got around the autostart - Thanks to all who contributed and allowed me to see the way. To stop the auto

Unable to stop MySQL on OS X 10.10

﹥>﹥吖頭↗ 提交于 2021-02-05 18:55:51
问题 I'm starting to go nuts over this. I setup MySQL/Apache/PHP using the tutorial by Coolest Guides On The Planet. I'm guessing something went wrong as its not working as expected so I want to uninstall and try again. The trouble is that I can't stop MySQL either by system preferences or command line. I keep trying suggestions on the net but so far unsuccessful. Can anyone help? 回答1: Finally got around the autostart - Thanks to all who contributed and allowed me to see the way. To stop the auto

Why this Hibernate MySQL Connection is read-only?

我的梦境 提交于 2021-02-05 18:08:05
问题 I have an application using Spring with Hibernate on a MySQL database. For some reason, as of the last few days, anytime I try to persist any objects to my database I am getting the following error: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed. * I can't for the life of me figure out why this is happening. My application was working fine a few days ago. I am configuring a SessionFactory object in my applicationContext.xml file like this:

Why does TRANSACTION / COMMIT improve performance so much with PHP/MySQL (InnoDB)?

别来无恙 提交于 2021-02-05 17:59:03
问题 I've been working with importing large CSV files of data; usually less than 100,000 records. I'm working with PHP and MySQL (InnoDB tables). I needed to use PHP to transform some fields and do some text processing prior to the MySQL INSERT s (part of process_note_data() in code below). MySQL's LOAD DATA was not feasible, so please do not suggest it. I recently tried to improve the speed of this process by using MySQL transactions using START TRANSACTION and COMMIT . The performance increase

Why this Hibernate MySQL Connection is read-only?

守給你的承諾、 提交于 2021-02-05 17:58:50
问题 I have an application using Spring with Hibernate on a MySQL database. For some reason, as of the last few days, anytime I try to persist any objects to my database I am getting the following error: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed. * I can't for the life of me figure out why this is happening. My application was working fine a few days ago. I am configuring a SessionFactory object in my applicationContext.xml file like this: