導航:首頁 > 編程系統 > sqlforlinux

sqlforlinux

發布時間:2022-08-19 00:25:50

『壹』 在linux下有什麼工具可以和PL/SQL DEVELOPER匹敵

試試:
Navicat for Oracle For Linux 11.1.7

另外,可以考慮基於java的工具:

比如Oracle自己的sql developer
AquaDataStudio
DbVisualizer

『貳』 Linux下如何運行sql腳本

Linux運行sql腳本的具體操作步驟如下:

1、使用shell工具登陸到安裝postgresql的伺服器,切換到postgres用戶,postgresql默認的操作用戶,命令是:su - postgres,查看當前路徑是/var/lib/psql,創建一個test.sql腳本文件,命令是:vim test.sql。

『叄』 請問,在linux下怎麼批量導入許多個sql文件進mysql如果一個個導入實在是太多了,可以打包一起導入嗎

編寫shell腳本導
cd /where_is_sql
for sql in $(echo *.sql)
do
mysql -h localhost -u root -p mydb < $sql
done

『肆』 sql查詢語句中所帶參數,在windows環境和linux環境java工程中為什麼表現不同

windows環境SQL語句

selectcount(*)='CaseBook'andresourceNoin('978-7-117-12632-8','978-7-117-16417-7','978-7-117-16418-4');

linux環境SQL語句

selectcount(*)='CaseBook'and
resourceNoin(''978-7-117-12632-8','978-7-117-16417-7','978-7-117-16418-4'');


很明顯Linux環境下的SQL語句在In里的兩側都多了一個【'】,你看看程序里寫的是否有錯誤吧,

這個應該和資料庫沒有關系的,是你程序在組織SQL語句時發生的錯誤

『伍』 plsql 在linux系統中能用嗎

可以的,你上網下載個能應用在linux平台的相關版本就行了。
例如:Download mod_plsql 0.3.15 for Linux

『陸』 怎麼在linux上安裝mysql

1. 運行平台:CentOS 6.3 x86_64,基本等同於RHEL 6.3
2. 安裝方法:
安裝MySQL主要有兩種方法:一種是通過源碼自行編譯安裝,這種適合高級用戶定製MySQL的特性,這里不做說明;另一種是通過編譯過的二進制文件進行安裝。二進制文件安裝的方法又分為兩種:一種是不針對特定平台的通用安裝方法,使用的二進制文件是後綴為.tar.gz的壓縮文件;第二種是使用RPM或其他包進行安裝,這種安裝進程會自動完成系統的相關配置,所以比較方便。
3. 下載安裝包:
a. 官方下載地址:
http://dev.mysql.com/downloads/mysql/#downloads
或鏡像文件下載:
http://dev.mysql.com/downloads/mirrors.html
2. 下載文件(根據操作系統選擇相應的發布版本):
a. 通用安裝方法
mysql-5.5.29-linux2.6-x86_64.tar.gz
b. RPM安裝方法:
MySQL-server-5.5.29-2.el6.x86_64.rpm
MySQL-client-5.5.29-2.el6.x86_64.rpm
4. 通用安裝步驟
a. 檢查是否已安裝,grep的-i選項表示匹配時忽略大小寫
[root@localhost JavaEE]#rpm -qa|grep -i mysql
mysql-libs-5.1.61-4.el6.x86_64
*可見已經安裝了庫文件,應該先卸載,不然會出現覆蓋錯誤。注意卸:載時使用了--nodeps選項,忽略了依賴關系:
[root@localhost JavaEE]#rpm -e mysql-libs-5.1.61-4.el6.x86_64 --nodeps
b. 添加mysql組和mysql用戶,用於設置mysql安裝目錄文件所有者和所屬組。
[root@localhost JavaEE]#groupadd mysql
[root@localhost JavaEE]#useradd -r -g mysql mysql
*useradd -r參數表示mysql用戶是系統用戶,不可用於登錄系統。
c. 將二進制文件解壓到指定的安裝目錄,我們這里指定為/usr/local
[root@localhost ~]# cd/usr/local/
[root@localhost local]#tar zxvf /path/to/mysql-5.5.29-linux2.6-x86_64.tar.gz
*加壓後在/usr/local/生成了解壓後的文件夾mysql-5.5.29-linux2.6-x86_64,這名字太長,我們為它建立一個符號鏈接mysql,方便輸入。
[root@localhost local]#ln -s mysql-5.5.29-linux2.6-x86_64 mysql
d. /usr/local/mysql/下的目錄結構

Directory

Contents of Directory

bin

Client programs and the mysqld server

data

Log files, databases

docs

Manual in Info format

man

Unix manual pages

include

Include (header) files

lib

Libraries

scripts

mysql_install_db

share

Miscellaneous support files, including error messages, sample configuration files, SQL for database installation

sql-bench

Benchmarks

e. 進入mysql文件夾,也就是mysql所在的目錄,並更改所屬的組和用戶。
[root@localhost local]#cd mysql
[root@localhost mysql]#chown -R mysql .
[root@localhost mysql]#chgrp -R mysql .
f. 執行mysql_install_db腳本,對mysql中的data目錄進行初始化並創建一些系統表格。注意mysql服務進程mysqld運行時會訪問data目錄,所以必須由啟動mysqld進程的用戶(就是我們之前設置的mysql用戶)執行這個腳本,或者用root執行,但是加上參數--user=mysql。
[root@localhost mysql]scripts/mysql_install_db --user=mysql
*如果mysql的安裝目錄(解壓目錄)不是/usr/local/mysql,那麼還必須指定目錄參數,如
[root@localhost mysql]scripts/mysql_install_db --user=mysql \
--basedir=/opt/mysql/mysql \
--datadir=/opt/mysql/mysql/data
*將mysql/目錄下除了data/目錄的所有文件,改回root用戶所有,mysql用戶只需作為mysql/data/目錄下所有文件的所有者。
[root@localhost mysql]chown -R root .
[root@localhost mysql]chown -R mysql data
g. 復制配置文件
[root@localhost mysql] cp support-files/my-medium.cnf /etc/my.cnf
h. 將mysqld服務加入開機自啟動項。
*首先需要將scripts/mysql.server服務腳本復制到/etc/init.d/,並重命名為mysqld。
[root@localhostmysql] cp support-files/mysql.server /etc/init.d/mysqld
*通過chkconfig命令將mysqld服務加入到自啟動服務項中。
[root@localhost mysql]#chkconfig --add mysqld
*注意服務名稱mysqld就是我們將mysql.server復制到/etc/init.d/時重命名的名稱。
*查看是否添加成功
[root@localhost mysql]#chkconfig --list mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
i. 重啟系統,mysqld就會自動啟動了。
*檢查是否啟動
[root@localhost mysql]#netstat -anp|grep mysqld
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2365/mysqld
unix 2 [ ACC ] STREAM LISTENING 14396 2365/mysqld /tmp/mysql.sock
*如果不想重新啟動,那可以直接手動啟動。
[root@localhost mysql]#service mysqld start
Starting MySQL.. SUCCESS!
j. 運行客戶端程序mysql,在mysql/bin目錄中,測試能否連接到mysqld。
[root@localhost mysql]#/usr/local/mysql/bin/mysql
Welcome to the MySQLmonitor. Commands end with ; or \g.
Your MySQL connection idis 2
Server version:5.5.29-log MySQL Community Server (GPL)

Copyright (c) 2000, 2012,Oracle and/or its affiliates. All rights reserved.
Oracle is a registeredtrademark of Oracle Corporation and/or its affiliates. Other names may betrademarks of their respective owners.
Type 'help;' or '\h' forhelp. Type '\c' to clear the current input statement.
mysql> quit
Bye
*此時會出現mysql>命令提示符,可以輸入sql語句,輸入quit或exit退出。為了避免每次都輸入mysql的全路徑/usr/local/mysql/bin/mysql,可將其加入環境變數中,在/etc/profile最後加入兩行命令:
MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin
這樣就可以在shell中直接輸入mysql命令來啟動客戶端程序了
[root@localhost mysql]#mysql
Welcome to the MySQLmonitor. Commands end with ; or \g.
Your MySQL connection idis 3
Server version:5.5.29-log MySQL Community Server (GPL)
Copyright (c) 2000, 2012,Oracle and/or its affiliates. All rights reserved.
Oracle is a registeredtrademark of Oracle Corporation and/or its
affiliates. Other namesmay be trademarks of their respective
owners.
Type 'help;' or '\h' forhelp. Type '\c' to clear the current input statement.
mysql>

5. RPM安裝步驟
a. 檢查是否已安裝,grep的-i選項表示匹配時忽略大小寫
[root@localhost JavaEE]#rpm -qa|grep -i mysql
mysql-libs-5.1.61-4.el6.x86_64
可見已經安裝了庫文件,應該先卸載,不然會出現覆蓋錯誤。注意卸載時使用了--nodeps選項,忽略了依賴關系:
[root@localhost JavaEE]#rpm -e mysql-libs-5.1.61-4.el6.x86_64 --nodeps
2. 安裝MySQL的伺服器端軟體,注意切換到root用戶:
[root@localhost JavaEE]#rpm -ivh MySQL-server-5.5.29-2.el6.x86_64.rpm
安裝完成後,安裝進程會在Linux中添加一個mysql組,以及屬於mysql組的用戶mysql。可通過id命令查看:
[root@localhost JavaEE]#id mysql
uid=496(mysql)gid=493(mysql) groups=493(mysql)
MySQL伺服器安裝之後雖然配置了相關文件,但並沒有自動啟動mysqld服務,需自行啟動:
[root@localhost JavaEE]#service mysql start
Starting MySQL.. SUCCESS!
可通過檢查埠是否開啟來查看MySQL是否正常啟動:
[root@localhost JavaEE]#netstat -anp|grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 34693/mysqld
c. 安裝MySQL的客戶端軟體:
[root@localhost JavaEE]#rpm -ivh MySQL-client-5.5.29-2.el6.x86_64.rpm
如果安裝成功應該可以運行mysql命令,注意必須是mysqld服務以及開啟:
[root@localhost JavaEE]#mysql
Welcome to the MySQLmonitor. Commands end with ; or \g.
Your MySQL connection idis 1
Server version: 5.5.29MySQL Community Server (GPL)
Copyright (c) 2000, 2012,Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademarkof Oracle Corporation and/or its affiliates. Other names may be trademarks oftheir respective owners.
Type 'help;' or '\h' forhelp. Type '\c' to clear the current input statement.
mysql>
d. RPM安裝方式文件分布

Directory

Contents of Directory

/usr/bin

Client programs and scripts

/usr/sbin

The mysqld server

/var/lib/mysql

Log files, databases

/usr/share/info

Manual in Info format

/usr/share/man

Unix manual pages

/usr/include/mysql

Include (header) files

/usr/lib/mysql

Libraries

/usr/share/mysql

Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation

/usr/share/sql-bench

Benchmarks

『柒』 linux 下訪問sql server

解壓文件 tar xvf odbc-sqlserver-1.4.27-linux-x86-glibc.tar

# cd odbc-sqlserver-1.4.27-linux-x86-glibc

# ls
all.tar dsn_template_ssl install_intro licenses_template unixodbc.tar.md5sum
all.tar.md5sum echo install_license license.txt unixodbc.tar.sum
all.tar.sum essqlservertarerr install_linkpaths licshell unixODBC_version.txt
check_root.txt ident install_other_procts OSname.txt uodbc
cmpver install install_paths sqlserver_create_dsn.sh uodbcinstall.txt
config.log install_check_linux INSTALL.txt SQLSERVER_uodbcinstall.txt uodbc_tmp
drv_template install_check_procts install_versioned tables_22189.sql versioned
drv_template_2236 install_check_root intro.txt tee
drv_template_ssl install_check_sunos licclient testlib
dsn_22189 install_check_tools license_request.txt unixODBC
dsn_template install_init licenses.out unixodbc.tar

執行install文件安裝ODBC驅動.(用root用戶執行)

#./install

這個集合了很多操作.每步都會彈出提示讓你進入下一步.

第一步提示Press the return key to read license,按回車即可.

接下來會刷很多license信息.Do you accept the license? (q=quit, yes, no):

如果接受,輸入yes.

然後會執行一些檢查命令,查看系統是否有基本一些命令工具的安裝.按回車進入下一步.

緊接著會檢查一些的包是否安裝.按回車進入下一步.

此時會提示安裝unixODBC需要依賴ODBC driver manager.按RETURN進入下一步.

然後會讓你輸入一些個人信息.不想輸的可以直接回車跳過.

接下來會有一步讓選擇licence.會有三個OPTION.

[0] Exit

[1] View existing licenses

[2] SQLServer ODBC Driver V1.2

Please choose the proct you would like a license for by entering its item number or enter one of the other options.

可以選擇2,但是選擇之後發現這個license是收費的..如果想出錢的話就去買.我是直接quit了的.進入下一步.

按要求一步步輸入IP地址,埠,用戶名,密碼,實例.它會自動測試你提供的東西是否正確.當有足夠信息去連接資料庫後,會提示輸入一個DSN名字.即為你的資料庫起一個名字,方便後邊登陸的時候使用.

這一步完成後,配置基本完成了.

別高興的太早,還要配置一個環境變數.

將LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/easysoft/sqlserver:/usr/local/easysoft/lib export LD_LIBRARY_PATH寫入到用戶profile文件中.注意路徑要正確.

現在就可以驗證啦.

#cd /usr/local/easysoft/unixODBC/bin

#./isql -v dsn_name

完成。

『捌』 linux上怎麼安裝mysql

安裝包:mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz

使用連接linux伺服器,使用root用戶名登錄,依次執行以下命令:

======================================================

/usr/sbin/groupadd mysql 【添加mysql組】

/usr/sbin/useradd -d /var/lib/mysql -s /sbin/nologin -g mysql mysql

mkdir -p /usr/local/src/mysql 【新建mysql文件夾】

cd / 【打開上傳安裝包的目錄】

mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz 【上傳安裝包到伺服器的根目錄下】

mv mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz /usr/local/src/mysql【根目錄的安裝包移動到文件夾下】

cd /usr/local/src/mysql【打開目錄】

tar -zxvf mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz【解壓安裝包】

cp mysql-5.6.30-linux-glibc2.5-x86_64 /usr/local/mysql -r【復制文件】

cd /usr/local【打開目錄】

chown -R mysql:mysql mysql/

cd /usr/local/mysql/scripts/【打開目錄】

./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data【執行腳本】

cd /usr/local/mysql/support-files【打開目錄】

cp my-default.cnf /etc/my.cnf【復制文件到新的路徑下及文件名】

cp: overwrite `/etc/my.cnf'?Y【Y】

cp mysql.server /etc/init.d/mysql【復制文件到新的路徑下】

vim /etc/profile【編輯軟體運行環境】
vim i(編輯一些內容) esc(進入normal) w(保存文件) q(不保存退出文件)
###############################################################
export MYSQL_HOME=/usr/local/mysql
export PATH=$MYSQL_HOME/bin:$PATH
###############################################################
source /etc/profile

chkconfig --add mysql

chkconfig mysql on

service mysql start
/usr/local/mysql/bin/mysqladmin -u root password 'rootroot'【修改資料庫root的密碼】

grant all privileges on tdcdb.* to 'root'@'%' identified by 'rootroot' 【給mysql用戶分配許可權】
flush privileges;

vim /etc/sysconfig/iptables【編輯訪問埠號】
###############################################################
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT(添加3306的埠號)
###############################################################
service iptables restart
netstat -ntlp

mysql -u root -p (命令未找到使用: ln -s /usr/local/mysql/bin/mysql /usr/bin)
create user 'tdc'@'%' identified by 'P@ssw0rd';【創建資料庫訪問用戶】
create database if not exists `tdcdb`;【創建資料庫】

grant all privileges on tdcdb.* to 'tdc'@'%' identified by 'P@ssw0rd';【給tdc用戶分配訪問密碼】
flush privileges;

vi /etc/my.cnf【編輯配置文件,支持語言設置】
###############################
[client]
default-character-set=utf8

[mysqld]
character-set-server=utf8

[mysql]
default-character-set=utf8
###############################
service mysql stop【重新啟動mysql服務】
service mysql start

======================================================

linux 常用命令:

pwd:查看當前路徑

ll:2個小寫的L,查看當前目錄下的所有文件

cd:打開目錄,包括路徑地址及文件夾

vi 文件名:編輯linux下的文件,使用大寫的【I】命令來進行編輯,編輯完成後點擊【ESC】按鈕跳出編輯,輸入【:wq!】命令來退出保存;

注意:linux的文件不能打開直接修改,只能通過vi命令進行修改

======================================================

卸載程序的方式:

ps -ef | grep mysql
/etc/init.d/mysql status
whereis mysql
find / -name mysql【找到所有文件名為mysql的文件列表】
rm -rf /usr/local/mysql/【使用rm命令來移除列表中的文件】
rm -rf /etc/my.cnf【使用rm命令來移除列表中的文件】

『玖』 Linux和SQL

很希望幫助你但是我就知道幾個,也不知道是不是你的意思參考下吧
1.linux 如何顯示文件的單行數
ll |awk -F ' ' '{ print $9}'
2.shell 寫郵件的怎麼寫程序
SMAIL()
{
{
echo "To: aaa" #發送到那
echo "From: bb" #從那發送
echo "Subject: $subject" #標題
echo "DateTime : $date" #內容
} > $mailtxt
cat $mailtxt | /usr/sbin/sendmail -t
}
SMAIL;
4.三張表A、B、C,有相同的欄位ID,怎麼一次將三張表的內容都刪掉
for x in A B C ;do mysql -e "delete form .....where id='id' "; done;

閱讀全文

與sqlforlinux相關的資料

熱點內容
女大學生的客房沙龍女主角叫什麼名字 瀏覽:486
有額度能提現的app 瀏覽:683
java定時任務timer 瀏覽:194
ps原文件存不了 瀏覽:481
怎麼徹底刪除微博數據 瀏覽:923
媒體評論馬化騰微信 瀏覽:744
好13網址大全 瀏覽:774
網路雙絞線 瀏覽:948
linux系統鏡像文件在 瀏覽:647
帕薩特如何用道通讀取鏈條數據 瀏覽:962
電影台灣三級小電影 瀏覽:636
誰有看片網址 瀏覽:461
win10中卸載顯示器 瀏覽:626
拳頭和天激斗 瀏覽:129
樹莓派雙核mcu怎麼編程 瀏覽:331
dnf安全網站哪個好 瀏覽:557
黑客工具箱手機版2016 瀏覽:363
秒開快播電影網 瀏覽:487
織夢安裝資料庫密碼 瀏覽:555

友情鏈接