SPSS連接mysql數(shù)據(jù)庫的超詳細操作教程
安裝MySQL ODBC驅(qū)動
官方說法:MySQL ODBC 驅(qū)動程序負責(zé)在開放式數(shù)據(jù)庫連接 API (ODBC API) 的幫助下訪問 MySQL
數(shù)據(jù)庫通俗說法:MySQL ODBC負責(zé)連接MySQL數(shù)據(jù)庫
注意: 要根據(jù)本機安裝的MySQL版本下載對應(yīng)的ODBC驅(qū)動程序。
MySQL數(shù)據(jù)庫創(chuàng)建表插入數(shù)據(jù)
create database spss_db charset=utf8; use spss_db; create table emp( empno int(4) primary key, ename varchar(10), job varchar(9), mgr int(4), hiredate date, sal decimal(7,2), comm decimal(7,2), deptno int(2) );
MySQL插入數(shù)據(jù)
insert into emp values (7369, 'Smith', 'clerk', 7902, '2030-12- 17', 800, null, 20), (7499, 'Allen', 'salesman', 7698, '2031-02- 20', 1600, 300, 30), (7521, 'Ward', 'salesman', 7698, '2031-02- 22', 1250, 500, 30), (7566, 'Jones', 'manager', 7839, '2031-04- 02', 2975, null, 20), (7654, 'Maritn', 'salesman', 7698, '2031- 09-28', 1250, 1400, 30), (7698, 'Blake', 'manager', 7839, '2031-05- 01', 2850, null, 30), (7782, 'Clark', 'manager', 7839, '2031-06- 09', 2450, null, 10), (7788, 'Scott', 'analyst', 7566, '2033-04- 19', 3000, null, 20), (7839, 'King', 'president', null, '2031-11- 17', 5000, null, 10), (7844, 'Turner', 'salesman', 7698, '2031- 09-08', 1500, 0, 30), (7876, 'Adams', 'clerk', 7788, '2033-05- 23', 1100, null, 20), (7900, 'James', 'clerk', 7698, '2031-12- 03', 950, null, 30), (7902, 'Ford', 'analyst', 7566, '2031-12- 03', 3000, null, 20), (7934, 'Miller', 'clerk', 7782, '2031-01- 23', 1300, null, 10);
SPSS連接MySQL數(shù)據(jù)庫的步驟
①點擊【文件】---->【導(dǎo)入數(shù)據(jù)】---->【數(shù)據(jù)庫】---->【新建查詢】
②點擊【添加ODBC數(shù)據(jù)源】
③點擊【添加】
④選擇【MySQL ODBC 8.0 Unicode Driver】
⑤填寫內(nèi)容,點擊ok
⑥點擊【確定】
⑦選擇剛才創(chuàng)建的數(shù)據(jù)庫連接,點擊【下一步】
⑧選擇數(shù)據(jù)庫中要導(dǎo)入的表與字段,點擊【下一步】
⑨點擊【完成】
⑩最終效果
總結(jié)
到此這篇關(guān)于SPSS連接mysql數(shù)據(jù)庫的超詳細操作教程的文章就介紹到這了,更多相關(guān)SPSS連接mysql數(shù)據(jù)庫內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
MySQL5.6 GTID模式下同步復(fù)制報錯不能跳過的解決方法
搭建虛擬機centos6.0, mysql5.6.10主從復(fù)制,死活不同步,搞了一整天找到這篇文章終于OK了,特分享一下,需要的朋友可以參考下2020-04-04mysql提示got timeout reading communication packets的解決方法
今天發(fā)現(xiàn)mysql錯誤日志中出現(xiàn)got timeout reading communication packets,一般情況因為部分頁面生成有問題導(dǎo)致,這里簡單分享一下解決方法2019-05-05